Estimating compressed storage size of digital data

ABSTRACT

Methods, systems and apparatus, including computer program products, for processing digital data. An approximate storage size is predicted for an output representation that uses variable length encoding. The approximate storage size can be used to determine one or more compression parameters to satisfy a global constraint, such as a maximum storage size for a compressed representation of the digital data. In a user interface, storage sizes can be graphically represented for multiple images. In the graphical representation, the storage size is represented for each image by a corresponding graphics object that includes a visual representation of the image and has a linear size that is proportional to the storage size of that image.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional application of, and claims priority to,U.S. patent application Ser. No. 10/849,409, entitled “EstimatingCompressed Storage Size Of Digital Data”, to inventor Richard L. Sites,which was filed on May 18, 2004. The disclosure of the above applicationis incorporated herein by reference in its entirety.

BACKGROUND

The present invention relates to processing digital data.

Digital data can represent digital images, sound tracks or any otherdigitized content. In digital images, digital data represent graphicsobjects, such as lines, shapes, photographs, paintings or images oftext. The graphics objects can be defined by vector graphics or by araster array of closely spaced pixels that are basic picture elements.Each pixel specifies local graphical attributes, such as color oropacity of a corresponding local portion of the image. The number ofpixels in an image is referred to as a resolution of the image. Pixelarrays are used in scanning, displaying and image capturing devices, andin computer applications, such as presentation, animation, painting ordesign applications.

A typical image includes correlations or repetitions within the pixelarray. Pixel values may be correlated within a shape or along lines, orpatterns or symbols may be repeated at multiple locations within thesame image. For example, the same character is typically repeated atmultiple locations in a scanned image of text. Compression techniquestake advantage of the correlations and repetitions to generatecompressed representations that are more compact than a bitmap in whicheach pixel is represented by a predetermined number of bits. Thecompressed representations can be lossy or lossless depending on whetherinformation is lost or not from the original image due to thecompression. Examples of compressed representations include JointPhotographic Experts Group (“JPEG”) format, Graphics Interchange Format(“GIF”), Tagged Image File Format (“TIFF”) and Joint Bi-level ImageExperts Group (“JBIG”) format.

A compressed representation typically includes one or more contentchannels for the digital data, where each content channel corresponds toa particular type of content. For example, a respective content channelcan be defined for each color component in a standard color space, suchas a red-green-blue (RGB) color space or a YUV color space. In the YUVcolor space, luminance is represented by Y, and chrominance isrepresented by U and V. Accordingly, the content channels can includeseparate Y, U and V channels. In each channel, the content isrepresented by data values for multiple representation components thatare separately addressable components in the compressed representation.

In a JPEG representation, a respective pixel array is defined for eachchannel. In the array, the pixels are grouped into sub-arrays ofeight-by-eight pixels. A discrete cosine transformation (“DCT”) isapplied to each sub-array to generate amplitude values for sixty-fourdifferent discrete frequencies (combinations of eight horizontal andeight vertical frequencies) that can be separately addressed. Thus eachDCT frequency is a representation component in the JPEG representation.

In lossy representations, the information loss is typically controlledby compression parameters, such as downsampling parameters orquantizors. Each downsampling parameter defines a resolution reductionfor a corresponding pixel array, and each quantizor defines acorresponding quantization of data values. For example, a horizontal orvertical downsampling parameter of two reduces by half the number ofpixels in each row or each column, respectively. Or a quantizor of twodefines a representation in which data can have only discrete values inunits of two.

Typically, separate compression parameters are used for differentcontent channels and different representation components. In JPEG, thechrominance channels are typically downsampled both horizontally andvertically, while the resolution is not reduced in the luminancechannel. Furthermore, each DCT frequency component has a correspondingquantizor. Typically, the higher the frequency component, the larger thecorresponding quantizor.

In general, digital data values can be represented according to fixedlength or variable length encodings. Fixed length encodings use a fixednumber of bits to represent different data values. For example in abitmap, each pixel value is represented by a predetermined number ofbits. Compressed representations, however, often use variable lengthencoding. In variable length encoding, different code values arerepresented by different number of bits. The number of bits that areused to represent a code value is referred to as the length of the codevalue. The code values represent data values according to an encoding.The encoding can specify a predetermined code value for each representeddata values. Alternatively, the code value can depend upon the frequencyof occurrence of the represented data value. To decrease storage sizes,JPEG representations typically use Huffman encoding in which the mostfrequent data values are represented by code values having the smallestlengths.

Before compressing a digital image into a JPEG representation or otherrepresentation using complex variable length encoding, traditionalsoftware applications do not try to predict a storage size for thecompressed representation of the image. Instead, the compressedrepresentation is actually generated, and the storage size of thegenerated representation is measured. If requested by a user, themeasured storage size is traditionally presented in numerical form in auser interface.

For compressing an image, some computer applications allow the user toselect one or more quality parameters that specify compressionparameters. The compressed representation is generated with thespecified compression parameters, and the storage size of the generatedrepresentation is presented to the user. If the storage size is toolarge or too small, the user can set new quality parameters. To verifywhether the new parameters define an acceptable storage size, the userhas to wait until a corresponding new compressed representation isgenerated. To find the quality parameters that provide the desiredstorage size, the user may have to guess several times, and wait eachtime for generating the corresponding representation. For compressing alarge amount of data, such as a large number of digital images, the usermay have to wait several seconds or even a few minutes betweensubsequent guesses.

SUMMARY

An approximate storage size is predicted for storing digital data in arepresentation that uses variable length encoding. The approximatestorage size can be used to determine one or more compression parametersto satisfy a global constraint, such as a maximum storage size for acompressed representation of the digital data. In a user interface,storage sizes can be graphically represented for multiple images. In thegraphical representation, the storage size is represented for each imageby a respective graphics object that includes a representation of theimage and has a linear size that is proportional to the storage size ofthat image.

In general, in one aspect, the invention provides methods and apparatus,including computer program products, for processing digital data.Digital data is received and code values of an input representation ofthe received digital data are identified. The code values have variablebit widths and represent data values for one or more representationcomponents. For each representation component, a first bit widthdistribution is generated, where the first bit width distributiondefines a respective frequency of occurrence for two or more differentbit widths based on bit widths of data values for that representationcomponent in the input representation. The generated first bit widthdistributions are used to estimate a storage size of an outputrepresentation that uses code values having variable bit widths torepresent the digital data.

Particular implementations can include one or more of the followingfeatures. The digital data can be received in the input representation.The representation components can include frequency components of adiscrete Fourier transform or a discrete cosine transform. The digitaldata can include a digital image. The input representation can includean input JPEG representation of the digital image. The outputrepresentation can include an output JPEG representation of the digitalimage. The input JPEG representation can be generated from a bitmaprepresentation of the digital image. Generating the input JPEGrepresentation can include sampling the bitmap representation of thedigital image. The input representation can includes markers to identifycode values, and the markers can be encoded based on a first Huffmanencoding. The markers can include code heads and end-of-block markers.The output representation can include markers encoded based on a secondHuffman encoding. The second Huffman encoding can be different from thefirst Huffman encoding. Estimating a storage size of the outputrepresentation can include estimating a total number of bits in theoutput representation, or estimating a transmission time fortransmitting the output representation over a link.

One or more compression parameters can be received for the outputrepresentation. Estimating the storage size of the output representationcan includes determining a respective bit reduction for eachrepresentation component based on one or more of the compressionparameters. For each representation component, the first bit widthdistribution can be modified based on the respective bit reduction togenerate a second bit width distribution that specifies estimatedfrequencies of occurrence for bit widths in the output representation.The second bit width distribution can be used to estimate the storagesize of the output representation. The compression parameters canspecify a respective quantizor for each representation component.Determining the respective bit reduction for each representationcomponent can include determining the respective bit reduction based onthe respective quantizor for each representation component. Estimatingthe storage size of the output representation can include, for eachrepresentation component, estimating a respective average number of codebits for each bit width in the second bit width distribution. Using thesecond bit width distribution to estimate the storage size can includemultiplying the respective average number of code bits with theestimated frequencies of occurrence specified by the second bit widthdistribution. The corresponding average number of bits can be estimatedbased on bit widths in the input representation. The digital data caninclude a digital image, the compression parameters can specify anoutput pixel resolution of the digital image in the outputrepresentation, and the storage size can be estimated based on theoutput pixel resolution. The input representation can specify an inputpixel resolution of the digital image, and estimating the storage sizebased on the output pixel resolution can include using a square root ofthe ratio of the input pixel resolution and the output pixel resolution.

In general, in another aspect, the invention provides methods andapparatus, including computer program products, for processing digitaldata. Digital data is received in a current representation, and one ormore target parameters are received for compressing the digital datainto an output representation. Based on the target parameters, one ormore compression parameter values are determined for the outputrepresentation. A storage size of the output representation is predictedbased on the compression parameter values, where the storage size ispredicted without generating the output representation with thecompression parameter values.

Particular implementations can include one or more of the followingfeatures. The output representation can use a variable length encodingto represent data values. Predicting a storage size of the outputrepresentation can include identifying code values of an inputrepresentation of the received digital data, where the code values havevariable bit widths and represent data values for one or morerepresentation components. For each representation component, a bitwidth distribution defining a respective frequency of occurrence for twoor more different bit widths can be generated based on bit widths ofdata values for the representation component in the inputrepresentation. A storage size of the output representation can beestimated based on the generated bit width distributions. The digitaldata can be received in the input representation.

Receiving digital data can include receiving a set of two or moredigital images. Predicting a storage size of the output representationcan include predicting a total storage size for the set of digitalimages. Determining one or more compression parameter values can includeselecting one or more of the images for compression and determining oneor more compression parameter values for the selected images. Receivingtarget parameters for compressing the digital data can include receivinga target quality. One or more of the images can be selected based on thetarget quality and quality parameters of the digital images in thecurrent representation. Selecting one or more of the images forcompression can include selecting one or more of the images based onstorage sizes of the digital images in the current representation.Selecting images based on storage sizes can include selecting one ormore images that have the largest storages sizes among the receivedimages.

Predicting the storage size of the output representation can includepredicting a total number of bits in the output representation, orpredicting a transmission time for transmitting the outputrepresentation over a link. Receiving one or more target parameters caninclude receiving user input in a user interface. The received userinput can specify a sequence of input values for a target parameter.Predicting the storage size of the output representation can includepredicting the storage size of the output representation for each inputvalue in the sequence of input values. In the user interface, thepredicted storage size of the output representation can be displayed foreach input value in the sequence without a perceivable delay relative tothe time of receiving the input value.

Receiving one or more target parameters can include receiving one ormore values of a target quality parameter for the output representation,and determining one or more compression parameters can includedetermining one or more quantizors for the output representation basedon the received values of the target quality parameter. Receiving one ormore target parameters can include receiving a target storage size forthe output representation. Determining one or more compression parametervalues for the output representation can include setting respectivetrial values of one or more quality parameters for the outputrepresentation. A trial storage size can be predicted for the outputrepresentation based on the trial values, and it can be verified whetherthe trial storage size is smaller than the target storage size. Settingrespective trial values of the quality parameters for the outputrepresentation can include setting trial values within an allowed range.The allowed range can be modified based on user input.

In general, in another aspect, the invention provides methods andapparatus, including computer program products, for processing digitaldata. One or more digital images are received in a currentrepresentation. In a user interface, a graphical representation ispresented, where the graphical representation indicates a respectivestorage size for each digital image. The graphical representationincludes a respective graphics object for each digital image, where therespective graphics object includes a visual representation of thedigital image and has a linear size that is proportional to the storagesize of the digital image.

Particular implementations can include one or more of the followingfeatures. For each digital image, the corresponding graphics object canenclose the visual representation of the image. Each digital image canbe distorted in proportion to the storage size of the image. For eachdigital image, the corresponding graphics object can have a linear sizethat is proportional to the storage size of the image in the currentrepresentation. User input specifying one or more target parameters foran output representation of the images can be received. A storage sizecan be estimated for one or more images in the output representationbased on the received target parameters. For each digital image, thelinear size of the corresponding graphics object can be set to beproportional to the estimated storage size of the image in the outputrepresentation. Receiving user input specifying one or more targetparameters can include presenting a respective slider for each targetparameter in the user interface, wherein at least one of the sliders isa user adjustable slider. The target parameters can be specifiedaccording to a current position of the user adjustable slider. A firsttarget parameter can have a first allowable range, and presenting aslider for the first target parameter can include presenting arepresentation of the first allowable range in the user interface. Userinput modifying the first allowable range can be received, and therepresentation of the first allowable range can be adjusted in the userinterface. The output representation can specify two or morerepresentation components for each image, and use code values havingvariable bit widths to represent data values. Estimating the storagesize of one or more images in the output representation can includeestimating the storage size for each representation components in theoutput representation based on a bit width distribution corresponding tothe representation component, where the bit width distribution defines afrequency of occurrence for two or more different bit widths based onbit widths of data values for the representation component. The storagesize of at least one digital image specifies a total number of bitsrepresenting the image in the output representation, or the storage sizespecifies a transmission time for transmitting the at least one image inthe output representation over a link. A reference storage size can bepresented in the user interface.

In general, in another aspect, the invention provides a system forprocessing digital data. The system includes an input device to receiveuser input specifying parameters for generating an output representationof digital data, wherein the output representation uses code valueshaving variable bit widths to represent the digital data. The systemalso includes a data processing device configured to identify codevalues of an input representation of the digital data, wherein the codevalues have variable bit widths and represent data values for one ormore representation components. The data processing device is alsoconfigured to generate a first bit width distribution for eachrepresentation component, and to use the generated first bit widthdistributions to estimate a storage size of the output representation.The first bit width distribution defines a respective frequency ofoccurrence for two or more different bit widths based on bit widths ofdata values for the representation component in the inputrepresentation.

Particular implementations can include one or more of the followingfeatures. The data processing device can include one or more componentsof a computer, or data processing components in a portable imagecapturing or image displaying device. The system can include a datastorage device that has an available storage capacity to store thedigital data. The data processing device can be configured to determinecompression parameters for the output representation of the digital databased on the available storage capacity of the data storage device. Thesystem can include a display device to present the estimated storagesize of the output representation. The digital data can include one ormore digital images, and the data processing device can be configured togenerate a graphical representation to indicate a respective storagesize for each digital image. The graphical representation can include arespective graphics object for each digital image, where the respectivegraphics object includes a visual representation of the digital imageand has a linear size that is proportional to the storage size of thedigital image. The display device can be configured to present thegenerated graphical representation.

The invention can be implemented to realize one or more of the followingadvantages. A storage size can be accurately predicted for compressingdigital data into a compressed representation that uses variable lengthencoding. The storage size can be predicted without actually generatingthe compressed representation. Instead, the estimate is based oncompression parameters and the content in the digital data. A storagesize can be predicted for compressing an input digital image into a JPEGrepresentation. The input digital image can be in any representation,such as a high quality JPEG format or a bitmap format. The storage sizecan be estimated and presented in a user interface without perceivabledelays to a user. Even for compressing a large amount of digital data,the storage size estimation can be fast enough to present instantestimates to a user who moves a slider selecting one or more targetparameters for the compression. The target parameters can include amaximum storage size or one or more parameters related to informationloss due to the compression of the digital data. For digital images, thecompression parameters can include a bitmap resolution or a compressionquality parameter. The storage size estimate can be accurate. Thus theestimated storage size can have a small error relative to the actualcompressed storage size. For example, an estimation error can be lessthan about fifteen percents of the actual compressed storage size, orless than about ten percents or even less than about five percents ofthe actual compressed storage size. The estimate can take into accountwhether or not the Huffman encoding changes when an image is compressed.The estimate of the storage size can also take into account the lengthsof code values used by the Huffman encoding for representation markers,such as end-of-block (“EOB”) markers.

A storage size can be estimated in a fast and efficient way for an imageset including a large number of images. The image set can include imagesto be attached to an electronic mail, or images to be stored in a devicesuch as a disk or a digital camera that has limited storage space.Compression parameters can be automatically determined to match a globalconstraint, such as a maximum storage size for the entire image set.Thus a user does not have to guess parameter values to match the globalconstraint. A reliable estimate can be quickly obtained for the entireimage set based on storage size estimates for only a few selected imagesin the set. The storage size estimate may have a small error for theentire set if the estimate is based on storage sizes of the largestimages in the set. Thus the storage size estimate addresses the storagesize for the entire image set, instead of calculating individualestimates for each image in the set. Compression parameters can bedetermined to optimize visual quality for the images after thecompression.

In a graphical interface, storage sizes can be graphically presented formultiple images by graphics objects, where each graphics object includesa corresponding image and has a linear size that is proportional to thestorage size of the image. In such graphical representations, a user caneasily identify which of the multiple images use large or small storagespace. Thus the user can easily select oversized images that need to becompressed, and decide how much the selected images should becompressed. Such graphical representations can also be used to presentstorage size estimates to a user. By presenting storage size estimates,the graphical representation can provide a visual feedback of whether aparticular compression achieves a desired goal, such as a maximumstorage size or a uniform distribution of storage sizes for differentimages. Based on the separate graphical representations for the storagesizes of the images in the set, the user can easily identify the imagesthat have large storage sizes. To match a maximum storage sizeconstraint for sending an image set, the user can effectively reduce thestorage size set by removing from the set the images that have largestorages sizes. The removed images can be sent separately from thereduced set.

The details of one or more implementations of the invention are setforth in the accompanying drawings and the description below. Otherfeatures and advantages of the invention will become apparent from thedescription, the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram illustrating a storage size estimator thatuses bit width distributions.

FIGS. 2, 4, 6, 8-11 and 13-16 are schematic flow diagrams illustratingmethods for storage size estimation.

FIGS. 3A-3E are schematic diagrams illustrating exemplary JPEGrepresentations.

FIG. 5 is a schematic diagram illustrating exemplary bit widthdistributions.

FIG. 7 is a schematic diagram illustrating modifications to exemplarybit width distributions for storage size estimation.

FIG. 12 is a schematic diagram illustrating a representation generatorto compress or decompress multiple images.

FIGS. 17-19 are schematic diagrams illustrating exemplary userinterfaces for compressing digital images.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

FIG. 1 illustrates a storage size estimator 100. The storage sizeestimator 100 receives an input representation 130 of digital data, andpredicts a storage size estimate 140 that is an approximate storage sizefor an output representation of the digital data. The storage size isdefined based on the number of bits used in the output representation torepresent the digital data. The storage size is defined independent ofwhether the output representation is actually stored or not in a storagedevice. For example, the storage size can explicitly specify the totalnumber of bits, or based on the total number of bits, the storage sizecan specify a transmission time for a particular transmission speed.Alternatively, the storage size can be any other function of the totalnumber of bits.

The input representation 130 and the output representation use variablelength encodings to represent the digital data. The outputrepresentation can use the same or a different encoding than the inputrepresentation 130. In one implementation, the input representation 130is a first JPEG representation of a digital image, and the storage sizeestimator 100 predicts the storage size estimate 140 for a second,typically more compressed JPEG representation of the same image. Thestorage size estimate 140 can be presented to a user or furtherprocessed. For example, the storage size estimate 140 can be used todetermine compression parameters for the digital image itself or forimages in an image set that includes the digital image.

The storage size estimator 100 can be implemented in one or moresoftware applications or as a plug-in to a software application. Thestorage size estimator 100 can also be implemented in hardware ofelectronic devices, such as image capturing or displaying devices. Forexample, the storage size estimator 100 can be implemented in digitalcameras, CCD devices, scanners, or portable devices such as personaldigital assistants or mobile phones. For portable devices, the storagesize estimator 100 or portions of it can be implemented on a remoteserver.

The input representation 130 specifies a variable length encoding 132and digital data 134 that is encoded based on the variable lengthencoding 132. The variable length encoding 132 associates code values torespective data values. The code values can have different lengths fordifferent data values. In one implementation, the variable lengthencoding 132 includes a bit-width encoding in which each code valueincludes only the “valuable” bits of the standard binary numbers. Thatis, the code value has a length defined by the highest location of 1 inthe standard form of binary numbers. Thus the number 0 has zero length,the number 1 has a length of one bit, the numbers 2 and 3 (binary 10 and11) have a length of two bits and the numbers 4-7 (binary 100-111) havea length of three bits, etc. Instead of using a fixed number of bits,such as an entire byte which includes eight bits, to represent a valueof five (00000101) or a value of three (00000011), these values arerepresented only by the last three (101) or two (11) bits, respectively.The number of valuable bits is referred to as the bit width of the datavalue.

The encoding 132 can also include a Huffman encoding specified by aHuffman code table. In Huffman encoding, code values having smalllengths are associated with data values that have a high frequency ofoccurrence in the digital data 134, and code values having large lengthsare associated with data values that have a low frequency of occurrencein the digital data 134. Instead of the bit-width or the Huffmanencoding, the variable length encoding 132 can include any othervariable length encoding that is specified implicitly or explicitly forthe input representation 130.

The encoded digital data 134 includes encoded data values for multiplerepresentation components 135_1-135_N. The representation components135_1-135_N are components that are separately addressed in the inputrepresentation 130. Thus the representation components 135_1-135_N canbe identified and separately manipulated in the input representation130. For example, data values can be differently encoded or quantized indifferent representation components. Or data values can be combinedaccording to predetermined rules from different representationcomponents 135_1-135_N to determine content represented by the digitaldata 134.

In one implementation, the digital data 134 includes encoded data valuesof a JPEG representation of a digital image, and the representationcomponents 135_1-135_N represent frequency components of a discretecosine transformation (“DCT”) that is applied to sub-arrays in a pixelarray of the image. In the JPEG representation, data values fordifferent DCT frequency components can be identified and separatelymanipulated. For example, low frequency DCT components can be quantizedby smaller quantizors than those for high frequency components. Or acomponent for zero DCT frequency (also called a “DC component”) can beencoded differently from components for non-zero DCT frequencies (alsocalled “AC components”). An exemplary JPEG representation is discussedbelow with reference to FIGS. 3A-3E.

The storage size estimator 100 generates the storage size estimate 140based on compression parameters 120 for the output representation andbit width distributions in a distribution set 110. The bit width refersto the number of valuable bits in a data value. Each bit widthdistribution is a function that, for each bit width that is available ina particular representation, specifies a frequency of occurrence of thedata values that have that bit width.

The storage size estimator 100 generates the bit width distributions inthe set 110 based on the data values represented in the encoded data 134of the input representation 130. The distribution set 110 includes Nseparate bit width distributions 110_1-110_N. Each of the bit-widthdistributions 110_1-110_N is generated based on data values in acorresponding subset of the encoded data 134. Each subset includesencoded data for one or more representation components of the inputrepresentation 130. Because the representation components areaddressable in the input representation 130, the storage size estimator100 can identify data values for each representation component and,based on the identified data values, generate the correspondingbit-width distribution in the set 110. Generating bit widthdistributions is further discussed with reference to FIG. 4.

The compression parameters 120 are parameters for compressing digitaldata into the output representation. The compression parameters 120 canbe received directly or can be derived from global parameters. Forexample, a user can provide a global compression quality parameter or amaximum storage size, and the compression parameters 120 can bedetermined by the storage size estimator 100 based on the globalparameters. For compressing a digital image, the compression parameters120 can specify resolutions for pixel arrays of different contentchannels, such as Y, U and V channels in a JPEG representation, orquantizors for quantizing data values, such as amplitude values of DCTfrequency components of the JPEG representation. Compression parametersfor JPEG representations are further discussed with reference to FIGS.3A-3E.

The compression parameters 120 include parameter sets 120_1-120_N. Eachof the parameter sets 120_1-120_N specifies compression parameters for acorresponding component in the output representation. For each of thesecomponents in the output representation, the storage size estimator 100generates a corresponding bit width distribution in the set 110. In theimplementation shown in FIG. 1, the parameters 120 specify compressionparameters for representation components that have a one-to-onecorrespondence with the components 135_1-135_N in the inputrepresentation 130. Thus for each representation components 135 _(—) i(i=1, . . . , N), the distribution set 110 includes a corresponding bitwidth distribution 110 _(—) i, and the compression parameters 120include a corresponding parameter set 120 _(—) i. If the compressionparameters 120 specify parameter sets only for selected components inthe output representation, bit width distributions can be specified onlyfor the selected components.

In alternative implementations, the output representation can includerepresentation components that are different from the representationcomponents 135_1-135_N in the input representation 130. For example, theoutput representation can have a combined component that includes datafrom two or more of the representation components 135_1-135_N. For thecombined component, a corresponding parameter set can be specified inthe compression parameters 120, and a corresponding bit widthdistribution can be determined for the distribution set 110.

FIG. 2 illustrates a method 200 that can be performed by a system thatincludes the storage size estimator 100 (FIG. 1) to predict a storagesize for a compressed representation of digital data. In oneimplementation, the digital data includes a digital image, and thesystem predicts storage sizes for an output JPEG representation of thedigital image.

The system receives digital data in an input representation that usesvariable length encoding (step 210). That is, data values arerepresented in the input representation by code values that havedifferent lengths. The input representation can include data values forone or more representation components. For a digital image in an inputJPEG representation, the representation components include DCT frequencycomponents. For each component, the data values can be encoded using abit-width, Huffman or any other variable length encoding.

In alternative implementations, the digital data can be received in anyrepresentation, and the system can determine the code values for theinput representation from the received digital data. For example, thesystem can generate the input representation from the received data, andidentify the code values in the input representation. Or the code valuescan be determined “on the fly” without actually generating the inputrepresentation or portions of it.

Based on the bit widths of the data values in the input representation,the system determines bit width distributions for one or morerepresentation components in an output representation (step 220). In theoutput representation, data values are encoded using a variable lengthencoding that includes a bit-width encoding or a Huffman encoding. Thevariable length encoding in the output representation can be the same ora different encoding than that in the input representation. The systemcan determine respective bit width distributions for all components, oronly a selected set of the components in the output representation. Forexample, bit width distributions can be determined only for thosecomponents that would be differently compressed in the outputrepresentation than in the input representation. The components that aredifferently compressed can be identified from the compressionparameters.

In the output representation, the components can correspond one-to-oneto representation components in the input representation. For a digitalimage, the input representation can be an input JPEG representation, andthe output representation can be an output JPEG representation that ismore compressed than the input JPEG representation. If the input andoutput JPEG representations specify the same DCT frequency components, arespective bit width distribution can be determined for each of theseDCT frequency components. Alternatively, one or more components of theoutput representation can be a combined component that corresponds tomultiple components in the input representation.

For each output representation component, the system determines acorresponding bit width distribution based on the input representation.If the output component corresponds to a single component in the inputrepresentation, the bit width distribution can be determined based uponbit widths of data values for that single component in the inputrepresentation. If the output component corresponds to multiplecomponents in the input representation, the bit width distribution canbe determined based upon bit widths of data values for the multiplecomponents in the input representation.

Each bit width distribution is generated by identifying bit widths ofdata values for the corresponding component or components in the inputrepresentation, as further discussed with reference to FIG. 4.Alternatively, the input representation may include metadata thatexplicitly specifies bit width distributions for one or more componentsin the input representation. Such metadata can be generated by a systemthat uses bit width distributions, such as a system that includes thestorage size estimator 100 (FIG. 1). The metadata can specify thedistributions by tables or statistical data that the system can analyze.If the output component is a combination of multiple input components,the system can determine the bit width distribution for the outputcomponent by an appropriate combination of the bit width distributionsfor the multiple input components.

The system estimates a storage size of the output representation of thedigital data based on the bit width distributions and compressionparameters specified for the output components (step 230). In oneimplementation, the system modifies the bit width distributions based onthe compression parameters for the output components, and estimates thestorage size of each output component in the output representation basedon the corresponding modified distribution. The system can estimate thestorage size for the entire output representation from the storage sizeestimates for the components. Estimating the storage size based on bitwidth distributions is further discussed with reference to FIGS. 6-9.

FIGS. 3A-3E illustrate exemplary JPEG representations of a digitalimage. The exemplary JPEG representations use a variable length encodingthat includes a bit-width encoding and a Huffman encoding. The exemplaryJPEG representations can be either input or output representations forthe storage size estimator 100 (FIG. 1). That is, the storage sizeestimator 100 can predict approximate storage sizes either based on orfor the exemplary JPEG representations.

FIG. 3A illustrates a JPEG generator 320 that receives a bitmap 310 of adigital image and generates a JPEG representation 330 of the receivedimage. In the bitmap 310, the received image is defined by an inputpixel array having an input resolution, such as 1200 pixels by 1600pixels. Each input pixel specifies red, green and blue (“RGB”) colorvalues in an RGB color space. Alternatively, the input pixels canspecify color values in another color space, such as acyan-magenta-yellow-black (“CMYK”) or a hue-saturation-luminance (“HSL”)color space. For each input pixel, the bitmap 310 uses a predeterminednumber of bits to represent the corresponding color values.

The JPEG generator 320 specifies a data transformation 322, aquantization 324 and a variable length encoding 326. First, the JPEGgenerator 320 applies the data transformation 322 to transform thereceived digital image into a particular format. Next, data values arequantized according to the quantization 324, and the quantized datavalues are encoded according to the variable length encoding 326. In oneimplementation, the variable length encoding 326 includes a bit-widthencoding and a Huffman encoding. The encoded data values are used togenerate the JPEG representation 330. Optionally, the generated JPEGrepresentation 330 can also include metadata to identify thetransformation 322, the quantization 324 or the encoding 326.

FIG. 3B illustrates a data transformation 340 that is an exemplaryimplementation of the data transformation 322 (FIG. 3A), which specifiesthe transformation of the received image into a particular format. Thedata transformation 340 specifies a color transformation 342, adownsampling 344 and a DCT transformation 346. The color transformation342 transforms color values specified by the pixels in the receivedimage into a target color space, such as a YUV color space or anothercolor space that separates luminance (Y) and chrominance (U and V). Thecolor transformation 342 is separately applied for each pixel in thereceived image.

For each component of the target color space, the data transformation340 defines a respective content channel and a corresponding pixelarray. Thus for the YUV color space, a luminance channel Y and twochrominance channels U and V are defined. In the pixel array of eachchannel, the pixels specify values only for the single color componentthat is represented by that channel. Thus luminance values are definedby pixels in the array of the luminance channel Y, and chrominancevalues are defined for the U and V components by pixels in the arrays ofthe channels U and V, respectively. In each of the content channels, thecorresponding array is first defined to have the same resolution as thepixel array of the received image.

The downsampling 344 is an optional transformation that can be used todecrease the storage size of the JPEG representation 330. Thedownsampling 344 is applied to reduce the resolution of the pixel arraysin one or more of the content channels. Decreasing the resolution in achannel causes information loss from the content represented by thatchannel. Because the human eye is more sensitive to luminance than tochrominance, the downsampling 344 decreases the resolution only in thechrominance channels U and V without altering the resolution in theluminance channel Y. Thus the information loss caused by thedownsampling is less visible to the human eye. For most images, thedownsampling 344 may decrease the resolution by a factor of two or fourin the chrominance channels without substantial degradation to visualquality of the image.

The DCT transformation 346 is applied in each content channel tosub-arrays of pixels, such as sub-arrays of eight-by-eight pixels. Ineach sub-array, the pixel values are transformed into amplitude valuesof the DCT frequency components. Thus the transformation generatesamplitude values for sixty-four separate DCT frequency components thatcan be labeled by a composite index (FX, FY) specifying a horizontalfrequency FX and a vertical frequency FY. With this or some otherlabeling, the different DCT frequency components are addressable and canbe used as representation components in the JPEG representation 330.

FIG. 3C illustrates an exemplary quantizor table 350 that can be used toquantize the amplitude values for the different DCT frequency componentsof the eight-by-eight sub-arrays. The same quantizor table 350 can beused for each content channel, or different quantizor tables can bedefined for different content channels. For example, luminance andchrominance channels can have different quantizor tables.

The quantizor table 350 specifies a corresponding quantizor for each ofthe DCT frequency components that are labeled by horizontal frequenciesX0-X7 and vertical frequencies Y0-Y7. Both the horizontal and verticalfrequencies are ordered according to increasing frequency values in thetable 350. Thus the DCT frequency component (X0,Y0) is the DC componentwhich has the smallest frequency value (which is zero) both horizontallyand vertically, and the component (X7,Y7) is an AC component that hasthe highest horizontal and vertical frequencies.

For the DC component (X0,Y0), the quantizor table 350 specifies a smallquantizor, which is 2 in the example. After applying the quantizor of 2,an integer multiple of 2 will separate different amplitude values forthe frequency component (X0,Y0). As the horizontal or the verticalfrequency increases, the table 350 specifies progressively largerquantizors. For the AC component (X7,Y7), the quantizor table 350specifies the largest quantizor, which is 12 in the example. Thus afterthe quantization, an integer multiple of 12 will separate differentamplitude values for the frequency component (X7,Y7).

In one implementation, quantized amplitude values are generated bydividing each amplitude value with the corresponding quantizor, andkeeping only the integer part from the result of the division. Thus zeroquantized amplitude is obtained for any amplitude value that is smallerthan the corresponding quantizor. Often, the amplitude values are smalland the quantizors are large for high horizontal or vertical DCTfrequencies. Thus for most of the high frequencies, the quantizedamplitudes become zero.

The larger the quantizor, the more information may be lost when it isapplied. For example, two values that differ by 4 will remain differentafter quantization by 2, but may have the same quantized value afterquantization by 12. Thus the information loss can be controlled for theJPEG representation by selecting appropriate quantizors. For example,each quantizors in the table 350 can be increased according to apredetermined function as a global compression quality parameterdecreases.

FIG. 3D illustrates an exemplary data block 360 in the JPEGrepresentation 330 (FIG. 3A). The data block 360 represents quantizedamplitude values for an ordered sequence of the DCT frequencycomponents. The block 360 can include data for all DCT frequencycomponents or only for a subset of the DCT frequencies, such as DCTfrequencies corresponding to a single horizontal frequency or a singlevertical frequency.

In one implementation, the data block 360 represents amplitude valuesfor all sixty-four DCT frequency components of an eight-by-eightsub-array. In the data block 360, the DCT frequencies are orderedaccording to an ordering path. An exemplary “zigzag” ordering path 352is illustrated in a table 355, where the horizontal and vertical DCTfrequencies are arranged the same way as in the table 350. Thus theordering path 352 is such that the lowest DCT frequencies are near thebeginning of the ordering path 352, and the highest DCT frequencies arenear the end of the ordering path 352.

The data block 360 includes data elements 361-364 and an EOB marker 365indicating the end of the block 360. The EOB marker 365 is used to closethe data block 360 after the last DCT frequency that has non-zeroquantized amplitude. Because quantized amplitude values are often zerofor large DCT frequencies, which are near the end of the ordering path,using the EOB marker 365 can decrease the storage size of the JPEGrepresentation.

Each of the data elements 361-364 represents quantized amplitude valuesfor one or more DCT frequency components, and includes exactly onenon-zero quantized amplitude value for a particular DCT frequency. Inaddition to the non-zero amplitude, each data element can also representone or more DCT frequencies that have zero amplitude values and precede(alternatively, follow) the particular frequency according to theordering of the DCT frequencies.

As illustrated for the data element 362, each data element includes acode head 366 and a code value 367. The code value 367 represents thenon-zero quantized amplitude value of the data element 362 according toa bit-width encoding that uses only the valuable bits of the non-zeroamplitude value. Thus the code value 367 uses a number of bits thatdepends upon the represented quantized amplitude value.

The code head 366 identifies which bits are used by the code value 367.The bits of the code value 367 follow the code head 366 that specifies abit length 368 to identify the number of bits for the code value 367.The code head 366 also specifies a zero run 369 to identify DCTcomponents that have zero amplitude values and immediately precede(alternatively, follow) the DCT frequency of the code value 367 in theorder of the DCT frequencies. Thus the DCT frequency component that hasnon-zero amplitude value represented by the data element 362 can beidentified based on the zero run 369 and the order of the DCTfrequencies.

In one implementation, the code head 366 is Huffman encoded. The Huffmanencoding is based on a relative number of occurrences of the differentvalues for the code head. The larger the number of occurrences of aparticular head value, the shorter the code value representing that headvalue.

Optionally, the Huffman encoding can be applied not only to the codeheads, but also to other elements of the data block 360, such as the EOBmarker 365. Thus the Huffman encoding will also depend on the relativefrequency of occurrence of the EOB markers. For a high quality JPEGrepresentation in which most quantized amplitude values are non-zeroeven for large DCT frequencies, the data blocks 360 are typically longand the relative occurrence of the EOB markers is small. Accordingly,the EOB marker's Huffman code will include many bits. In a highlycompressed JPEG representation, however, quantized amplitude values arenon-zero only for the smallest DCT frequencies, and the data blocks 360are typically short. Thus the EOB marker has a large relative frequencyof occurrence, and its Huffman code will include only a few bits.

FIG. 3E illustrates an exemplary JPEG representation 370 of a digitalimage. The JPEG representation can be generated by the JPEG generator320 (FIG. 3A), and includes Huffman codes 372, quantizors 374 andencoded digital data 375. The JPEG representation 370 can be implementedin a single or multiple files. For example, the encoded digital data 375can be included in a first file that includes only references, such asnames or pointers, to identify one or more separate files in which theHuffman codes 372 and the quantizors 374 are specified.

The encoded digital data 375 includes data for a luminance channel 376and two chrominance channels 377 and 378. In each channel, the datavalues are represented by data blocks 379, where each data blockcorresponds to an eight-by-eight sub-array in the pixel array of thechannel. Each of the data blocks 379 has a structure similar to that ofthe block 360 (FIG. 3D), which represents encoded quantized amplitudevalues for all sixty-four DCT frequency components.

The Huffman codes 372 specify the relation between the code values inthe data blocks and the corresponding values of the code heads. TheHuffman codes 372 can be defined by one or more Huffman tables, whereeach Huffman table defines a corresponding Huffman encoding. Forexample, separate Huffman encodings can be defined for luminance andchrominance channels. Based on the Huffman codes 372, the code heads canbe identified and decoded in each of the data blocks 379. The decodedhead values identify corresponding bit lengths and zero runs. Theidentified bit length specifies which bits represent the non-zeroamplitude value for a particular DCT frequency, and the identified zerorun specifies the number of DCT frequencies that have a zero quantizedamplitude value and immediately precede (alternatively, follow) theparticular DCT frequency.

The quantizors 374 specify the quantizor values that have been used toquantize the amplitude values of different DCT frequencies. Thequantizors 374 can include one or more quantizor tables, such as thequantizor table 350 (FIG. 3C). For example, separate quantizor tablescan be specified for luminance and chrominance channels.

The Huffman codes 372 and the quantizors 374 can be used to uncompressthe encoded digital data 375. First, the Huffman codes 372 are used toidentify and decode the code heads. Based on the bit lengths and zeroruns in decoded code heads, the quantized amplitude values areidentified for each DCT frequency component in each eight-by-eightsub-array. Next, the quantizors 374 are used to “stretch” out thequantized amplitude values. For example, each quantized amplitude valueis multiplied by the corresponding quantizor. To present theuncompressed image in a representation similar to the bitmaprepresentation 310, the inverse of the data transformation 322 can beapplied to the “stretched” amplitude values.

FIG. 4 illustrates a method 400 to determine bit width distributions andaverage numbers of code bits for predicting storage size for compressedrepresentations that use variable length encoding. The method 400 can beperformed by a system including the storage size estimator 100 (FIG. 1).The system predicts the storage size based on an input representationthat specifies one or more representation components. For example, theinput representation is a JPEG representation that specifies DCTfrequency components for a digital image.

For a particular representation component, the system identifies bitwidths of data values and corresponding numbers of code bits in theinput representation (step 410). To identify the bit widths of the datavalues in a JPEG representation, the system identifies code values thatrepresent non-zero quantized amplitudes for corresponding DCTfrequencies. The respective bit widths are defined by the valuable bitsof the quantized non-zero amplitudes. In the JPEG representation, thebit width is explicitly specified for the respective non-zero quantizedamplitude in the corresponding head code 366 by the bit length 369 (FIG.3D).

To determine the number of code bits, the system identifies encoded datavalues that represent data for the particular representation component.For each identified data value, the system determines the number of codebits that are used in the input representation for the encoded datavalue.

For the exemplary data block 360 (FIG. 3D), the system identifies thedata elements 361-364, and for each element, the corresponding codevalue 367 and the DCT frequency for which the code value 367 specifies anon-zero amplitude. For the identified DCT frequency, the number of codebits is defined to include the number of bits that are used by the codevalue 367 itself, and optionally, one or more bits of the code head 366.For example, the bits specifying the bit length 368 of the code value367 can be included in or excluded from the number of code bits for theDCT frequency of the code value 367.

The code head 366 also specifies the zero run 369, which defines thenumber of preceding DCT frequencies having zero amplitude. For thesezero-amplitude DCT frequency components, the system can evenlydistribute the number of bits representing the zero run 369. Inalternative implementations, the code bits of the entire code head 366can be associated with the code value 367, and the zero-amplitude DCTfrequency components can be defined to have zero code bits. The systemcan also separately estimate a storage size for metadata, such as thecode heads 366, EOB markers 365 or other Huffman encoded markers. Insuch implementations, the system assigns the number of bits of the codevalue 367 exclusively to the non-zero amplitude DCT frequency, andassigns zero code bits to the DCT frequency components having zeroamplitudes.

For each bit width, the system determines frequencies of occurrence fordata values having that bit width (step 420). A frequency of occurrencespecifies a number of data values that have the corresponding bit width.In one implementation, each frequency of occurrence is calculated basedon data values for a particular representation component in a particularcontent channel. In a JPEG representation, a respective frequency ofoccurrence is determined for each bit width, each DCT component and eachof the luminance and chrominance channels. In a numeric example, 16different bit widths (0, . . . , 15) are allowed for quantized amplitudevalues of each of 64 DCT components in each of the 3 channels, a totalof (16×64×3=) 3072 frequencies of occurrences are determined. In analternative representation, a single frequency of occurrence can bedefined for each bit width and each representation component based ondata values for all content channels. For the above numeric example, thealternative implementation defines (16×64=) 1024 separate frequencies ofoccurrence.

To determine frequencies of occurrence for a particular representationcomponent in a particular channel, the system defines a first tableincluding a respective count number for each bit width (“w_i”, i=1, . .. , M) that is available to represent data values in a compressedrepresentation. The count numbers in the first table have preset values,such as zeros. Each time a bit width of a data value is determined, thecount number corresponding to that bit width in the first table isupdated, that is, incremented by one. After updating the first tablebased on the bit widths of all the data values for the particularcomponent in the particular channel, the count numbers in the firsttable specify the respective frequency of occurrence (“FO_i”) for eachbit width w_i. Thus the first table specifies a bit width distributionfor the particular representation component in the particular channel.

For each bit width of the data values for each representation componentin each channel, the system determines a corresponding average number ofcode bits (step 430). Each average number of code bits specifies thenumber of bits used on average by data values that have a particular bitwidth and represent data for a particular representation component in aparticular content channel. For the above numeric example, 3072 separateaverage numbers of code bits are determined. If a single average numberof code bits is defined for each bit width and each representationcomponent based on data values for all content channels, only 1024separate average numbers of code bits is required in the numericexample.

To determine the average numbers of code bits (“ACB_i”) for a particularrepresentation component in a particular channel, the system defines asecond table including a respective count number for each available bitwidth w_i. The count numbers in the second table have preset values,such as zeros. Each time the system determines a number of code bits fora data value for the particular representation component in theparticular channel, the system updates the count number corresponding inthe second table to the bit width of the data value. The updateincrements the count number by the number of code bits determined forthe data value. After updating the second table based on the data valuesfor the particular representation component in the particular channel,the count numbers in the second table specify respective numbers of codebits (“CB_i”) used for the bit widths w_i.

For each bit width w_i, the average number of code bits ACB_i can bedetermined by dividing the corresponding number of code bits CB_i withthe frequency of occurrence FO_i for the bit width w_i, as

ACB _(—) i=CB _(—) i/FO _(—) i i=1, . . . , M.  (Eq. 1)

Without addressing different bit widths separately, a total number ofcode bits (TNCB) represents the content in the data values for theparticular representation component in the particular channel. Thus thetotal number of code bits TNCB specifies a storage size for the contentin the particular representation component in the particular channel.The total number of code bits TNCB can be determined by summing up thenumber of code bits CB_i for all available bit widths w_i as

TNCB=Σ_(i)CB_i=Σ_(i)ACB_iFO_i i=1, . . . , M.  (Eq. 2)

In Eq. 2, the second equality is based on Eq. 1 and determines the totalnumber of code bits TNCB from the average number of code bits ACB_i andthe frequency of occurrence FO_i for all available bit widths.

By using the method 400, an arbitrarily large JPEG representation can becharacterized by a few thousand numbers that specify frequencies ofoccurrence and average numbers of bits for all available bit widths,representation components and content channels.

FIG. 5 illustrates exemplary bit width distributions 501, 502 and 564,corresponding to a first, second and 64^(th) DCT components for aparticular content channel in an input JPEG representation that useszero to fifteen bits to represent each quantized DCT amplitude. For eachof the distributions 501, 502 and 564, the different bit widths arerepresented on a horizontal axis and frequencies of occurrence (“FO”)are illustrated by a corresponding histogram. For each bit width, thevertical dimension of the histogram is proportional to the frequency ofoccurrence for that bit width. For example, the bit width distribution501 illustrates that most of the first DCT component's amplitude valueshave a bit width of three bits, and no amplitude values have bit widthsthat are larger than six bits.

If the zero amplitude values are defined to be represented by zero bits,the zero bit-width has no contribution to the storage size. Thus thezero bit-width element can be omitted or arbitrarily defined in each ofthe bit width distributions 501-564. For example, the zero bit-widthelement can be defined to have zero frequency of occurrence, asillustrated for the exemplary distributions 501-564. Alternatively, oneor more of the zero bit-width elements can be used to store other datasuch as a count of EOB or other markers, such as markers indicating apredetermined number of consecutive zeros, for example 16 consecutivezeros.

FIG. 6 illustrates a method 600 for modifying a bit width distributionto predict a storage size of an output representation that uses variablelength encoding and is characterized by particular output compressionparameters. The method 600 can be performed by a system including thestorage size estimator 100 (FIG. 1).

The system receives bit width distributions of data values in an inputrepresentation (step 610). Each of the received bit width distributionscorresponds to a respective representation component. If the inputrepresentation is a JPEG representation including multiple DCTcomponents for a digital image, the system can receive a respective bitwidth distribution for each of the DCT components.

The system receives compression parameters for an output representation(step 620). The output representation specifies the same representationcomponents as the input representation, but the received compressionparameters specify a different data compression for the outputrepresentation than that in the input representation. For an inputrepresentation including a JPEG representation of a digital image, theoutput representation can include another JPEG representation for whichthe received compression parameters specify a different compressionquality. For example, the received compression parameters can specifylarger quantizors for one or more DCT components in the output JPEGrepresentation than those in the input JPEG representation.

The system determines a bit reduction for each representation componentbased on the received compression parameters (step 630). The bitreduction is an average difference between the bit widths ofcorresponding quantized data values in the input and outputrepresentations. For a particular data value that is quantized by alarger quantizor in the output representation than in the inputrepresentation, the quantized data value will have a smaller value and areduced bit width in the output representation. For the particular datavalue, the bit reduction is the difference between the original and thereduced bit widths.

The bit reduction can be predicted for arbitrary data values based onthe quantizors in the input and output representations. For eachrepresentation component (j=1, . . . , N), the data values are quantizedwith a corresponding quantizor (“QI_j”) in the input representation, andthe received compression parameters specify another, typically larger,quantizor (“QO_j”) for the output representation. The bit reduction(“BR_j”) is determined for each component by the two-based logarithm(“log₂”) of the ratio of the corresponding quantizors in the input andoutput representations. That is,

BR _(—) j=log₂(QI _(—) j/QO _(—) j)  (Eq. 3).

If the ratio (QI_j/QO_j) is an integer power n of two (that is 2^(n)),the bit reduction BR_j is the integer power n itself.

If the ratio (QI_j/QO_j) is not an integer power of two (2^(x), where xis a non-integer number), the bit reduction BR_j=x indicates an averagereduction of bit widths. For a particular data value, the bit reductioncan be any of the two adjacent integer bit reductions that are closestto the non-integer bit reduction. For each of the two adjacent integerbit reductions, a weight can be determined such that on average the bitreduction corresponds to the non-integer BR_j. The weights can bedefined to be independent of the original bit width, or separate weightscan be determined for different original bit widths. For a particularbit width, the system assumes that all possible data values areuniformly represented in the image. Then the system divides eachpossible value by 2^(x) and calculates the integer bit reduction forthat value. Based on the calculated integer reduction, the weight isdetermined for the two possible integer bit reductions. For a bit widthof three, which allows four binary values (100, 101, 110 and 111), aprobability of ¼ is assigned to each value. After dividing by 2^(x) eachof the four values, if the bit reduction is n for three values and n+1for a single value, the system assigns a weight of ¾ to the bitreduction n, and a weight of ¼ to the bit reduction of n+1.

The system generates modified bit width distributions from the receivedbit width distributions based on the respective bit reductions (step640). That is, each received bit width distribution corresponds to arespective representation component, and is modified based on the bitreduction determined for that representation component. If the bitreduction is an integer number n, the modified distribution is generatedby shifting the received bit width distribution towards smaller bitwidths by the number n of bits. If zero bit width has no associatedstorage size, the system disregards any portion of the distribution thatis shifted to zero bit width or below. Exemplary shifts of bit widthdistributions are discussed below with reference to FIG. 7.

If the bit reduction is not an integer number, the modified bit widthdistribution can be generated based on the weights of the two adjacentinteger bit reductions corresponding to the non-integer bit reduction.Each bit width is reduced by both of the two integer reductionsaccording to their respective weights. Alternatively, the received bitwidth distribution can be first shifted with the non-integer bitreduction. Thus the shifted distribution will specify frequencies ofoccurrence for non-integer bit widths from which the system candetermine frequencies of occurrence for integer bit widths by aninterpolation.

FIG. 7 illustrates exemplary bit width distributions 710, 720 and 730.The bit width distributions 710-730 correspond to the same DCT componentin different JPEG representations that use zero to fifteen bits for eachquantized DCT amplitude. For each of the distributions 710-730, thedifferent bit widths are represented on a horizontal axis andfrequencies of occurrence (“FO”) are illustrated by a correspondinghistogram. For each bit width, the vertical dimension of the histogramis proportional to the frequency of occurrence for that bit width.

In the example, the bit width distribution 710 corresponds to an inputrepresentation in which the amplitude values have been quantized by aninput quantizor Q0=2. The bit width distributions 720 and 730 aremodified bit width distributions for a first and a second outputrepresentation in which the amplitude values will be quantized by afirst and a second quantizor Q1=4 and Q2=16, respectively. Thusaccording to Eq. 3, the bit reduction is one bit for the first outputrepresentation and three bits for the second output representation.

As illustrated for particular bit widths by the arrows 742, 744, 752 and754, the modified distributions 720 and 730 are generated by shiftingthe input distribution 710 with the respective bit reductions. Thus themodified distribution 720 is generated by shifting the distribution 710by one bit. For zero bit width, the frequency of occurrence is definedto be zero both before and after the shift. The arrow 742 illustratesthe corresponding shift for the bit width of five in the distribution710 to the bit width of four in the modified distribution 720, and thearrow 752 illustrates the shift for the bit width of nine in thedistribution 710 to the bit width of eight in the modified distribution720.

The modified distribution 730 is generated by shifting the distribution710 by three bits. The arrow 744 illustrates the corresponding shift forthe bit width of five in the distribution 710 to the bit width of two inthe modified distribution 730, and the arrow 754 illustrates the shiftfor the bit width of nine in the distribution 710 to the bit width ofsix in the modified distribution 730.

FIG. 8 illustrates a method 800 for estimating storage size of digitaldata in compressed representations that use variable length encoding. Inone implementation, the digital data represents a digital image and thecompressed representations include JPEG representations of the digitalimage. The method 800 can be performed by a system including the storagesize estimator 100 (FIG. 1).

The system receives bit width distributions that are generated from aninput representation, and are modified for an output representation(step 810). The output representation specifies multiple representationcomponents and the received bit width distributions include a respectivebit width distribution for each component. The modified bit widthdistribution specifies a respective frequency of occurrence (FO′_i) foreach bit width w_i (i=1, . . . , M) that is available for data valuesfor the corresponding representation component. For an output JPEGrepresentation of a digital image, the system can receive three timessixty-four bit width distributions, one for each DCT component in eachcontent channel. The bit width distributions can be generated from aninput JPEG representation and modified for the output JPEGrepresentation, as discussed above with reference to FIGS. 6 and 7.

The system receives a respective average number of code bits for eachbit width in each representation component in each channel (step 820).For a representation component in a particular channel, each averagenumber of code bits (“ACB_i”) specifies the number of bits used onaverage to represent data values that have the corresponding bit widthw_i in that representation component of the particular channel. In oneimplementation, the average number of code bits is determined from theinput representation, as discussed above with reference to FIG. 4.Alternatively, the average numbers of code bits can be estimated basedon the encoding that is used in the output representation.

Based on the modified bit width distributions and the correspondingaverage number of code bits, the system determines a total number ofbits for the output representation (step 830). First, a respective totalnumber of code bits (TNCB′) is determined for each representationcomponent and each channel in the output representation. Based on theEq. 2 above, the total number of code bits TNCB′ can be determined forthe particular component and channel by summing up for all available bitwidths w_i the product of the average number of code bits ACB_i and thecorresponding frequency of occurrence FO′_i from the modified widthdistribution as

TNCB′=Σ_(i)ACB_iFO′_i i=1, . . . , M,  (Eq. 4).

The total number of code bits TNCB′ specifies a storage size for theparticular representation component in the particular channel. For theentire output representation, the total number of code bits isdetermined by summing the total number of code bits of allrepresentation components in all channels. The result of the summingprovides an estimated storage size for content in the outputrepresentation.

In addition to code bits used for content, the output representation mayrequire additional storage size for metadata that specify encodings,quantizors or other information related to the output representation. Ifthe metadata has similar structure in the output representation to thatin the input representation, the total storage size can be estimated forthe output representation by calculating a ratio of the total number ofcode bits used for content in the output and input representations, andmultiplying this ratio with the total storage size of the inputrepresentation. Alternatively, the storage size estimate can becorrected according to the structural differences between the input andoutput representations.

According to the method 800, a storage size can be predicted for theoutput representation using bit width distributions and average numberof code bits that characterize the data to be compressed. In oneimplementation, the prediction can be performed on a typical computerwithin a time that is less than about 50 milliseconds such as less thanabout ten milliseconds, for example about five milliseconds or less.Thus the prediction can be performed and the result presented in a userinterface without perceivable delays to a user adjusting acompression-parameter slider.

FIG. 9 illustrates a method 900 that can be performed by a systemincluding the storage size estimator 100 (FIG. 1) to predict storagesize of compressed representations using variable length encoding. Themethod 900 can be performed to modify a storage size estimate that isbased on an input representation, where the estimate is modified topredict a storage size for an output representation in which thevariable length encoding is different from that in the inputrepresentation.

In one implementation, the input and output representations are JPEGrepresentations that use different Huffman encodings. If the outputrepresentation is substantially more compressed than the inputrepresentation, the number of non-zero DCT amplitudes is substantiallysmaller in the output representation than in the input representation.Thus the relative frequency of occurrence can be substantially largerfor encoding markers, such EOB markers, in the output representationthan in the input representation. Because Huffman encoding selects shortor long codes based on relative frequencies of occurrence, a new Huffmanencoding can select a shorter code for the coding markers in the outputrepresentation. For example, the EOB marker can have a length of four orfive bits in the input representation and only a single bit in theoutput representation. In the output representation, the number of EOBmarkers may become a substantial fraction, such as one third or one halfof the number of non-zero DCT amplitude values. Thus the change in theEOB code can substantially modify the storage size of the outputrepresentation.

To determine the storage size modification, the system estimates thenumber of non-zero encoded data values in the output representation(step 910). For example, the system determines bit width distributionsbased on the input representation, and modifies the bit widthdistributions for the output representation. From the modifieddistributions, the number of non-zero encoded data values can beestimated by summing up the frequencies of occurrence for bit widthsthat represent non-zero encoded data values.

The system determines a bit length of one or more markers based on theestimated number of non-zero encoded data values in the outputrepresentation (step 920). In one implementation, the system estimatesthe bit length of the EOB marker for an output JPEG representation.First, the system determines the number of data blocks and thecorresponding estimated number of EOB markers in the outputrepresentation. Next, a total number of output data items is calculatedby adding the number of EOB markers to the estimated number of non-zeroencoded data values. The system determines the length of the EOB markerbased on a frequency of occurrence of the EOB marker in the outputrepresentation. The EOB's frequency of occurrence is the ratio of thenumber of EOB markers to the total number of the output data items.

In one implementation, the system determines that the EOB marker in theoutput representation has a length of:

-   -   one bit if the EOB's frequency of occurrence is larger than        about one half;    -   two bits if the EOB's frequency of occurrence is between about        one half and about one quarter;    -   three bits if the EOB's frequency of occurrence is between about        one quarter and about one eighth; and    -   the same as in the input representation if the EOB's frequency        of occurrence is less than about one eighth.

In alternative implementations, bit lengths can be estimated for themarkers from a complete Huffman encoding that is calculated for theoutput representation. The complete Huffman encoding can be calculatedbased on bit width distributions that specify frequencies of occurrencefor different bit widths in the output representations. Because theHuffman encoding depends on relative frequencies of occurrence ofdifferent data values, a complete Huffman encoding can be calculatedbased on the bit width distributions. Or a complete Huffman encoding canbe determined based on a sample representation that is generated fromselected portions of the digital data.

The system modifies the estimated storage size of the outputrepresentation based on the determined length of the markers (step 930).For example, the system can modify the estimated storage size with astorage size correction that is a product of the number of EOB markersand the difference between the length of EOB markers in the inputrepresentation and in the output representation.

FIG. 10 illustrates a method 1000 that can be performed by a systemincluding the storage size estimator 100 (FIG. 1) to predict a storagesize of an output JPEG representation of a digital image that isreceived in an input JPEG representation. In alternativeimplementations, the method 1000 can be used to predict a storage sizeof an output Lempel-Zif-Welch (“LZW”) representation, or arepresentation using Flate or another compressed format such as the faxformat of the Comité Consultatif International Téléphonique etTélégraphique (CCITT). The method 1000 can be used to predict a storagesize if the resolution of the image is smaller in the outputrepresentation than that in the input representation.

The system receives downsampling parameters for the outputrepresentation (step 1010). The downsampling parameters define adownsampling that is a resolution decrease of the image in the outputrepresentation. The downsampling is defined by a reduction in thedimensions of pixels arrays in one or more color channels, such as aluminance channel Y or two chrominance channels U and V in the outputrepresentation. The received downsampling parameter can specify thereduction of the array dimensions relative to the dimensions of pixelarrays in the input representation. Alternatively, explicit dimensionscan be specified for the pixel arrays in the output representation.

Based on the received downsampling parameters, the system estimates theeffect of the downsampling to a storage size of the outputrepresentation (step 1020). In one implementation, the image isrepresented in the input representation by a first rectangular pixelarray having H1 rows and W1 columns, and in the output representation,by a second rectangular pixel array having H2 rows and W2 columns (H2<H1and/or W2<W1). Thus the number of eight-by-eight sub-arrays has beenreduced by a factor of (H1*W1)/(H2*W2) for the output representation.

Although the number of data blocks has been reduced, the number ofnon-zero DCT amplitude values typically increases in each block due tothe downsampling, because downsampling produces more high DCT frequencycomponents. Intuitively, if the image includes E well separated edgesalong a line in the input representation, there will be about E edgesalong the same line even after the downsampling. Because these edgeswill be closer to each other in the output representation, they can berepresented by high DCT frequency components. If some of the E edges aretoo close to each other in the input representation in the image, thedownsampling may average out these close edges. Thus for the closeedges, no high DCT frequency components will be needed to represent themin the output representation.

The above effects upon the storage size can be estimated based onempirical formulas. According to one such formula, if the number of rowsand the number of columns are reduced for the output representation bythe same downsampling parameter R (W2=W1/R and H2=H1/R), the number ofcode bits increases by a factor of about the square root of thedownsampling parameter R. Because the number of blocks is reduced in theoutput representation by a factor of R², the system estimates that thestorage size of the output representation is about 1/R^(1.5) times thestorage size of the input representation.

FIG. 11 illustrates a method 1100 for estimating a storage size of aJPEG representation of a digital image. The method 1100 can be performedby a system that includes the storage size estimator 100 (FIG. 1).

The system receives an image in a representation other than a JPEGrepresentation (step 1110). For example, the image can be receiveddirectly from an image editing computer application in a bit map. Or auser can select a bit map or a TIFF format of the image for JPEGcompression.

The system selects portions from the received image according to apseudo random scheme to generate a sample image (step 1120). The imageportions can be selected to faithfully represent statistical propertiesof DCT amplitudes for the JPEG representation. If the JPEGrepresentation defines blocks of eight-by-eight pixel for a DCTtransformation, the image portions can be selected to include completeeight-by-eight pixel sub-arrays. Furthermore, amplitude values aretypically delta-encoded for the zero DCT frequency components in JPEGrepresentations. The delta encoding uses the difference of amplitudevalues between adjacent sub-arrays in the image. To faithfully representthe delta encoding of the zero DCT frequency component, the system canselect about ten or more subsequent sub-arrays in the image along thesame direction that is used by the JPEG representation. The sample imageis generated from the selected image portions.

The system generates a JPEG representation of the sample image (step1130). In one implementation, the sample's JPEG representation hashigher quality (smaller quantizors) than any of the output JPEGrepresentations for which a storage size should be predicted.Alternatively, the sample's JPEG representation can have substantiallythe same quality (quantizors) as a particular output JPEGrepresentation.

If the selected portions define a fraction 1/S of the received image,the JPEG representation can be generated from the selected portionsabout S times faster than a JPEG representation of the entire receivedimage. For the sample image, the fraction 1/S can be selected tooptimize the time required for generating the sample image and its JPEGrepresentation while receiving a storage size with an acceptableaccuracy. In one implementation, the fraction 1/S is selected from therange between 1/10 and 1/100 for images including one million to 100million pixels.

The system uses the JPEG representation of the sample image to estimatea storage size for one or more output JPEG representations of thereceived image (step 1140). In one implementation, the system generatesbit width distributions from the sample's JPEG representation, modifiesthe bit width distributions according to compression parameters for theoutput JPEG representations, and estimates storage sizes based on themodified bit width distributions. If the sample's JPEG representationhas the same quantizors as the particular output JPEG representation,but different pixel resolution, the storage size can be estimated basedon the empirical formulas discussed above with reference to FIG. 10. Thesame JPEG representation of the sample image can be used for multiplestorage size estimates.

Instead of JPEG representations, the method 1100 can be used toaccelerate estimating storage sizes of any other output representations,such as LZW, Flate or CCITT fax representations. For transmitting animage in a CCITT fax format, a storage size, such as a total number ofbits and corresponding transmission time can be estimated by selectingone tenth of the image, generating a sample CCITT fax using the selectedportions, and multiplying the storage size of the sample fax by ten.Thus the storage size estimate is approximately accelerated by a factorof ten compared to an estimate that is based on a fax representation ofthe entire image.

FIG. 12 illustrates a representation generator 1220 to compress ordecompress two or more (“M”) digital images 1210_1-1210_M in a set 1210of digital images. The image set 1210 is a collection of images to becompressed based on storage parameters for the entire collection. Thestorage parameters can include a desired storage size or image qualityfor the entire set 1210.

The image set 1210 can be a user selected image collection such as aslide show that the user whishes to compress for archivation. Or theimage set 1210 can include images to be stored on a storage device withlimited storage size, or to be transmitted by an electronic mail servicethat sets limitations on the storage size of transmitted files. In oneimplementation, the representation generator 1220 is implemented in adigital camera or other image capturing device that has limited storagecapacity.

In the image set 1210, each image 1210 _(—i (i=)1, . . . , M) isspecified in a compressed representation, such as a JPEG, LZW, Flate orCCITT fax or any other representation. The representation of each image1210_i has a corresponding set 1212_i of current compression parameters.For JPEG representations, the compression parameters 1212_1-1212_M caninclude separate resolutions for luminance and chrominance channels, orseparate quantizors for different DCT frequency components. Instead ofJPEG representations, the images 1210_1-1210_M can be specified in anyother compressed representation with or without variable lengthencoding. Alternatively, one or more images in the set 1210 can bespecified in an uncompressed format, such as a bitmap.

The representation generator 1220 includes a datacompressor/decompressor 1222, a compression parameter calculator 1224and a storage size estimator 1226. The compressor/decompressor 1222generates new compressed representations of the images 1210_1-1210_M. Inone implementation, the compressor/decompressor 1222 includes the JPEGgenerator 320 (FIG. 3A). If a new compressed representation has beengenerated for an image in the set 1210, the representation generator1220 can replace the representation of the image in the set 1210 withthe new representation. The compressor/decompressor 1222 can alsodecompress a compressed representation of an image into a bitmaprepresentation, as discussed above with reference to FIGS. 3A-3E. Thegenerated bit map representation can be used to present the image in auser interface.

The compression parameter calculator 1224 calculates new compressionparameters for one or more images in the set 1210 based on storageparameters 1225 for the entire set. The storage parameters 1225 can bedefined based on hardware limitations, or specified by user input. Forexample, the storage parameters 1225 can specify a maximum storage sizethat is based on a capacity of a storage device. Or a user input canspecify a preferred storage size or a preferred image quality for theimage set 1210.

The compression parameter calculator 1224 can automatically determinenew compression parameters for the images in the set 1210 based on thestorage parameters 1225. For example, the new compression parameters canbe determined by modifying the current compression parameters andestimating a storage size for the modified compression parameters, asdiscussed below in detail with reference to FIG. 13. The new compressionparameters can be used by the compressor/decompressor 1222 to generatenew compressed representations for the images in the set 1210.

The storage size estimator 1226 estimates a storage size for the entireimage set 1210 based on compression parameters for one or more images inthe set 1210. In one implementation, the storage size estimator 1226includes the storage size estimator 100 (FIG. 1), and can predict astorage size for compressing a particular image. That is, the storagesize estimator estimates a storage size for the image without generatingthe corresponding compressed representation.

In one implementation, the storage size estimator 1226 predicts astorage size for each image in the set 1210, and combines the predictedsizes to estimate a storage size for the entire set 1210. Alternatively,the storage size estimator 1226 can select one or more images from theset 1210, predict a storage size for the selected images, and estimate astorage size for the entire set 1210 based on the predictions for theselected images, as discussed below in more detail with reference toFIG. 14. Thus the storage size estimator 1226 can estimate the storagesize for the image set 1210 in a fast and efficient way withoutgenerating any compressed representation.

In alternative implementations, the storage size estimator 1226estimates a storage size for the entire set 1210 based on compressedimage representations that are generated by the compressor/decompressor1222. For example, the storage size estimator 1226 can select one ormore uncompressed images from the set 1210, and thecompressor/decompressor 1222 can generate compressed representations forthe selected images. Or the storage size estimator 1226 can generate asample image that is based on one or more images in the set 1210, andthe compressor/decompressor 1222 can generate a compressedrepresentation of the sample image. Based on the storage size of thegenerated compressed representations, the storage size estimator 1226can estimate the storage size for the entire set 1210, as discussedbelow in more detail with reference to FIG. 14.

The estimated storage size of the image set 1210 can be used by thecompression parameter calculator 1224 to calculate new compressionparameters for the images in the set 1210, as discussed below withreference to FIG. 13. Alternatively, the storage size estimate can bepresented to a user who tries to adjust a quality parameter or anotherstorage parameter for the image set 1210 in a user interface. For theuser, the presented estimate provides a useful feedback about thestorage size for the current storage parameter.

FIG. 13 illustrates a method 1300 for compressing a set of images. Themethod 1300 can be performed by a system that includes therepresentation generator 1220.

The system receives an image set that includes multiple images (step1310). In the received set, each image is specified in a compressedrepresentation characterized by a set of compression parameters that arereferred to as input compression parameters. The compressedrepresentations can include any representations where the compressedstorage size can be varied by one or more parameters. For a JPEGrepresentation, the input compression parameters can include resolutionsfor luminance and chrominance channels or quantizors for DCT frequencycomponents. In alternative implementations, one or more images in thereceived set can be specified in uncompressed representations, such asbitmaps. For uncompressed representation, the system can definecompression parameters that will be used as input compressionparameters.

The system receives one or more storage parameters for the entire imageset (step 1320). The received storage parameters can specify a desiredor a maximum storage size for the image set, or a quality parameter thatdefines resolutions, quantizors or any other parameters related toinformation loss due to a compression of the image set. The storageparameters can be specified based on user input or characteristics of astorage device. For example, a user can specify a maximum storage sizefor the received image set, or a maximum quality level for compressingthe images in the set. The maximum quality level can be used to selectimages that have a higher quality than the specified maximum, and thesystem can generate new representations only for the selected images. Orthe user can specify a minimum quality level that defines a lowestquality that is acceptable for the compressed images in the set.

The system specifies current compression parameters for each image inthe set based on the storage parameters for the entire image set (step1330). The current compression parameters can be derived from the inputcompression parameters of the images in the received set. If thereceived image set includes uncompressed representations of the images,the system defines high-quality compression parameters that are usedinstead of the input compression parameters. The specified compressionparameters can include resolutions of content channels, quantizors forrepresentation components or any other parameter upon which a storagesize of the compressed representation depends.

The current compression parameters can be derived from the inputcompression parameters based on the received storage parameters, such asa storage size or a quality level for the entire set. To match a maximumquality level for the image set, the system selects images that havehigher quality than the maximum quality level, and modifies the inputcompression parameters only for the selected images to match the maximumquality level.

To decrease the storage size below a maximum storage size for the entireset, the system selects one or more images in the received set, andmodifies the input compression parameters to decrease the storage sizeof the selected images. Typically, the storage size is decreased bydecreasing the input quality that is defined by the input compressionparameters. For example, the resolution can be decreased in one or morecontent channels, or the quantizors can be increased for one or morerepresentation components. If a minimum quality level is defined for theimage set, the system can specify only compression parameters thatdefine qualities above the defined minimum.

In one implementation, the storage size is decreased according to apredefined schedule. For example, first the quantizors are increased forthe representation components, and next the resolution is decreased forone or more content channels. The predefined schedule can be optimizedfor human perception of image quality, or can be previously set based onuser input.

The system estimates a storage size for the entire image set based onthe current compression parameters (step 1340). In one implementation,the system estimates a separate storage size for each image in the setbased on the corresponding current compression parameters, and combinesthe estimated storage sizes of the individual images into an estimatefor the entire set. The system can predict the storage size for eachimage without actually generating the compressed representationaccording to the current compression parameters. Thus the storage sizecan be quickly and efficiently estimated for image sets that include asmall number of images, such as less than about ten or less than aboutfive images.

To increase efficiency for image sets that include more images, thesystem can select a few images from the set, predict respective storagesizes for the selected images based on the current compressionparameters, and estimate a storage size for the entire set based on thepredictions for the selected images.

In alternative implementations, the storage size can be determined forone or more images in the set by actually generating the compressedrepresentations according to the current compression parameters, anddetermining the storage size of the generated representations.

The system determines whether the current compression parameters shouldbe modified (decision 1350). To match a maximum storage size for theimage set, the system compares the estimated storage size with themaximum storage, and modifies the compression parameters if theestimated storage size is larger than the maximum storage size. To matcha desired storage size, the system determines whether the estimatedstorage size is out of or within a predefined tolerance about thedesired storage size, and decides to modify or not to modify thecompression parameters accordingly.

Alternatively, the system can present the current storage size estimateto a user, and request user input to determine whether the currentcompression parameters should be modified. If the user has specified adesired quality level for the image set, the system presents theestimated storage size that corresponds to the desired quality level.Thus the user can decide based on the estimated storage size whether thecurrent compression parameters should be modified or not. If the usermodifies the desired quality level for the image set, the systemdetermines that the current compression parameters should be modified.

If the compression parameters should be modified (“Yes” branch ofdecision 1350), the system specifies new compression parameters (returnsto step 1330). When the system returns to step 1330, the new compressionparameters can be specified based on the previous compression parametersin addition to the input compression parameters. For example, the systemcan compare the storage sizes for the previous and input compressionparameters, and based on the comparison, determine whether qualityshould be increased or decreased relative to the quality defined by theprevious compression parameters.

If the compression parameters should not be modified (“No” branch ofdecision 1350), the system uses the current compression parameters togenerate compressed representations for the images in the image set(step 1360).

FIG. 14 illustrates a method 1400 for estimating storage size forcompressing an image set including multiple images. The method 1400 canbe performed by a system that includes the representation generator1220.

The system selects one or more images in the image set (step 1410). Theimages are selected to represent the image set for estimating a storagesize for the entire set. In one implementation, the number of selectedimages depends upon the number of images in the entire set. For example,the system selects about five images if the set includes more than fivebut less than twenty-five images. For image sets including more thantwenty-five images, the number of selected images can be about thesquare root of the number of images in the set. Alternatively, thenumber of selected images can be a linear or other increasing functionof the number of images in the set.

In alternative implementations, the system selects a predefined numberof images, or requests user input to determine the number of selectedimages. The user input can indicate the number of selected imagesexplicitly. Alternatively, the user input can indicate a tolerance forthe storage size estimate and the system can determine the number ofselected images based on the indicated tolerance.

In one implementation, all the images in the set have the same type ofinput representation, and the system selects the images that have thelargest input storage sizes in that type of representation. In consumerapplications, the image set often includes JPEG images whose inputstorage size and compression parameters moderately vary from image toimage. For example, the image set can include photographs captured withthe same image capturing device. In such implementations, complex scenesare likely represented by the JPEG images having the largest inputstorage sizes in the image set. Although the complex scenes generatemore high DCT frequency components, the lower DCT components are alsopresent in these images. Thus it is reasonable to assume that the JPEGimages with the largest storage sizes will also represent how thesmaller DCT frequency components will be compressed in the JPEG imagesthat have less complexity and smaller storage size. If the input storagesize varies substantially from image to image in the set, the imageswith the largest storage sizes may dominate the storage size for theentire set. Thus selecting the images with the largest storages sizes istypically advantageous for predicting how the entire set will becompressed.

Instead of selecting only images having the largest storage sizes, thesystem can also select images that have other input storage sizes in theimage set. For example, images with small input storage sizes can beselected from image sets that include only a few images having largeinput storage sizes and a large number of images that have small inputstorage sizes.

For the selected images, the system estimates storage size of compressedrepresentations based on current compression parameters (step 1420). Inone implementation, the system includes the storage size estimator 100(FIG. 1), and predicts the storage sizes for the selected images withoutactually generating the corresponding compressed representations. Thusthe storage size of the selected images can be quickly and efficientlyestimated. In alternative implementations, the system generates thecompressed representations for one or more of the selected images, anddetermines the storage size of the generated representations.

The system estimates a compressed storage size for the entire image setbased on the storage size estimates for the selected images (step 1430).In one implementation, the system estimates that the storage size forthe entire image set is changing in proportion to the storage sizechange for the selected images. That is, the system determines acompression ratio from the estimated and input storage sizes for theselected image, and multiplies the compression ratio with the inputstorage size for the entire image set.

In alternative implementations, the system can classify the images inthe set and determine a respective compression ratio for each class. Forexample, the images can be classified based their input storage sizes orinput compression parameters in the image set. For a particular class,the compression ratio may be estimated based on storage size estimatesfor selected members of the class. A compression ratio of one is usedfor images whose representation remains unchanged in the compressed set.Each compression ratio can be used to estimate the compressed storagesize for the images in that class. The estimate for the entire set isobtained by summing up the estimated storage sizes for all classesrepresenting the set.

FIG. 15 illustrates a method 1500 for estimating a storage size based onan output quality level specified for compressing images in an imageset. In the image set, the images are represented in inputrepresentations, and the output quality level is specified forcompressing the images into output representations. For example, inputJPEG representations of the images are compressed into more compactoutput JPEG representations. The method 1500 can be performed by asystem that includes the representation generator 1220.

The system receives an output quality level for compressing an image set(step 1510). For example, the output quality level can be received froma user, as discussed in more detail below with reference to FIGS.17-18B. In one implementation, the output quality level specifies arespective minimum quantizor for each representation component in theoutput representation. For JPEG representations, a discrete set ofquality levels can be defined, for example, by integer numbers betweenzero and twelve. Each quality level corresponds to a respectivequantizor table for DCT frequency components. As the quality levelincreases, the respective quantizor decreases or remains unchanged foreach DCT frequency component.

In alternative implementations, the output quality level specifies arespective maximum resolution for one or more content channels in theoutput representation. For JPEG representations, the output qualitylevel can correspond to a first resolution in the luminance channel anda second resolution in the chrominance channels. As the output qualityincreases, the respective resolution increases or remains unchanged ineach of the luminance and chrominance channels.

In the image set, the system identifies images that have higher qualitythan specified by the output quality level (step 1520). That is, thehigh quality images have smaller quantizors for one or morerepresentation components, or larger resolution for one or more contentchannels.

The system selects one or more of the identified high quality imagesbased on their input storage size (step 1530). In one implementation,the system selects images that have the largest input storage sizesamong the identified high quality images. Alternatively, the systemselects images whose storage sizes represent those for all the highquality images.

Based on the selected high quality images, the system estimates astorage size for compressing all the high quality images to match theoutput quality level (step 1540). In one implementation, the systemfirst estimates a respective storage size for compressing each of theselected images to match the output quality level, and determines acompression ratio relative to the input storage size of the selectedimages. Next, the system uses the compression ratio to estimate acompressed storage size for all images that are identified to havehigher quality than that specified by the output quality parameter.

FIG. 16 illustrates a method 1600 for storing an image set that includesan increasing number of images. The method 1600 can be performed by asystem that includes the representation generator 1220. In oneimplementation, the system includes a storage device or an imagecapturing device that has a limited storage capacity to store an imageset that includes an increasing number of images.

The system receives a maximum storage size for the image set (step1610). The maximum storage size can be based on user input or a limitedstorage capacity of a device that stores the image set. For example, auser can set the maximum storage size to limit the storage capacity thatis used to store the image set.

The system adds one or more images to the image set (step 1620), anddetermines whether the image set should be compressed to match themaximum storage size (decision 1630). If no compression is required(“No” branch of decision 1630), the system waits until more images areadded to the image set (return to step 1620).

If the storage size of the image set exceeds the maximum storage size,the system determines that the image set should be compressed (“Yes”branch of decision 1630). The system uses storage size estimates todetermine compression parameters for compressing the storage size of theimage set below the maximum storage size (step 1640). For JPEG images,the determined compression parameters can include quantizor tables forDCT frequencies or resolutions for luminance or chrominance channels. Inone implementation, the system includes the storage size estimator 100to predict storage size estimates for trial compression parameterswithout generating the corresponding trial compressed representations.Based on the predictions, the system can quickly and efficientlydetermine compression parameters for compressing the image set below themaximum storage size.

The system verifies whether the determined compression parameters areacceptable (decision 1650). In one implementation, the system verifieswhether the determined compression parameters define a quality that isabove a minimal quality. The minimal quality can be specified by minimalresolutions for content channels or by maximum quantizors forrepresentation components. The minimal quality can also be specified asa particular level on a predefined scale that includes discrete levelscorresponding to different resolutions or quantizor tables.

If the compression parameters are not acceptable (“No” branch ofdecision 1650), the system requests further instructions (step 1660).For example, the system can notify a user or a system operator that theimage set with the added images cannot be compressed below the maximumstorage size according to the minimal quality. Thus the user or thesystem operator can instruct the system to change the allowed maximumstorage size or minimum image quality, or to decrease the number ofimages in the image set. In alternative implementations, the system canautomatically store only the previous image set without the addedimages.

If the compression parameters are acceptable (“Yes” branch of decision1650), the system generates a new compressed representation of the imageset according to the determined compression parameters (step 1670), andwaits until new images are added to the image set (return to step 1620).

FIG. 17 illustrates an exemplary user interface 1700 for specifyingcompression parameters for an output JPEG representation of a digitalimage. The user interface 1700 can be used by a system that includes therepresentation generator 1220 (FIG. 12). The system receives the digitalimage in an input JPEG representation and compresses it into an outputJPEG representation. In alternative implementations, the user interface1700 can be used to compress more than one images or to generatecompressed representations other than JPEG representations.

The user interface 1700 includes a storage size slider 1710, a JPEGresolution slider 1720 and a JPEG quality slider 1730 to indicate or toset storage parameters for the output JPEG representation. The storagesize slider 1710 is used to indicate or set a storage size for theoutput JPEG representation, the JPEG resolution slider 1720 is used toindicate or set a resolution in the luminance or chrominance channelsfor the output JPEG representation, and the JPEG quality slider 1730 isused to indicate or set a JPEG quality for the output JPEGrepresentation. The JPEG quality represents a quality level in a set ofpredefined quality levels, where each quality level corresponds to arespective predefined quantizor table for DCT frequency components. Foreach DCT component, the corresponding quantizor increases or remainsunchanged as the quality level increases.

In alternative implementations, one or more of the sliders 1710, 1720and 1730 can be omitted, or the user interface 1700 can specifydifferent sliders. For example, the user interface can include only thestorage size slider 1710 and the JPEG quality slider 1730. Or the JPEGresolution slider 1720 and JPEG quality slider 1730 can be combined intoa single combined quality slider. On the combined quality slider eachposition can correspond to a predefined combination of a JPEG resolutionand a JPEG quality. The combination of JPEG resolution and quality canbe selected to provide an optimized visual perception of the compressedimage. For a typical image, more quality degradation is perceived fordecreasing JPEG resolution than for decreasing JPEG quality. Thus thecombined quality parameter can be defined such that as it decreases fromits maximum value, the JPEG quality is decreased first without changingthe JPEG resolution, and the JPEG resolution is decreased only at lowJPEG qualities.

The input JPEG representation is characterized by an original storagesize, an original JPEG resolution and an original JPEG quality that arerepresented on the sliders 1710, 1720 and 1730 by input markers 1712,1722 and 1732, respectively. The input markers 1712, 1722 and 1732 alsoindicate a maximum storage size, a maximum JPEG resolution and a maximumJPEG quality, respectively, for the output JPEG representation, becausethese storage parameters are not increased when the image is compressed.

On the sliders 1710, 1720 and 1730, minimum markers 1714, 1724 and 1734indicate minimum storage parameters for the output JPEG representation,in particular, a minimum storage size, a minimum JPEG resolution and aminimum JPEG quality, respectively. These minimum storage parameters aredefined to keep parameters of the output JPEG representation within anacceptable range. The minimum storage parameters can be specified inabsolute units, such as 20 kByte for a minimum storage size or 640×320pixels for minimum luminance resolution. Alternatively, one or moreminimum storage parameters can be specified by percentages relative tothe respective original parameters. The minimum storage parameters canalso be defined based on user input, for example, by allowing the userto move the minimum markers 1714, 1724 and 1734 on the respectivesliders 1710, 1720 and 1730.

In the exemplary implementation of FIG. 17, the input markers 1712, 1722and 1732 and the minimum markers 1714, 1724 and 1734 include graphicalrepresentations of rectangles that are positioned on the respectivesliders 1710, 1720 and 1730. In alternative implementations, the inputmarkers 1712, 1722, 1732 or the minimum markers 1714, 1724 and 1734 canbe omitted, hidden or indicated by audio or animated presentations. Forexample, one or more of the markers can be indicated by a dinging bell,similar to indicating margins on a traditional typewriter.

On each slider 1710, 1720 and 1730 a respective cursor 1716, 1726 and1736 indicates a current value of the corresponding storage parameterfor the output JPEG representation. The user can select and move one ofthe cursors 1716, 1726 and 1736 to specify storage parameters for theoutput JPEG representation. In the example illustrated in FIG. 17, thecursor 1716 is selected by the user to specify a desired storage sizefor the output JPEG representation. Alternatively, the user can selectthe cursor 1726 or 1736 to specify a desired JPEG resolution or adesired JPEG quality, respectively.

The cursors 1716, 1726 and 1736 are coupled to each other by the system.Thus when the user moves the cursor 1716 to a position corresponding toa particular storage size for the output JPEG representation, the systemcalculates compression parameters for the particular storage size, forexample, as discussed above with reference to FIG. 13. Based on thecompression parameters, the system determines a JPEG resolution and aJPEG quality for the particular storage size, and moves the cursors 1726and 1736 to positions that correspond to the determined JPEG resolutionand quality, respectively. Thus the user receives a visual feedback onhow the JPEG resolution and quality change if the input JPEGrepresentation is compressed to the particular storage size. Based onsuch visual feedback, the user can make more informed decisions abouthow to compress the image.

To calculate the compression parameters for the particular storage size,the system can predict the storage sizes for trial compressionparameters without generating the corresponding compressedrepresentations. Thus the compression parameters can be calculatedquickly and efficiently. In one implementation, the system performs thecalculations for coupling the cursors 1716, 1726 and 1736 in a fractionof a second, such as less than about one hundred milliseconds. Thus thecursors 1716, 1726 and 1736 can be coupled in real time, without a delayperceivable to the user who is moving the cursor 1716 to select adesired storage size.

Alternatively, the user can select and move the cursor 1726 to adjustthe JPEG resolution for the output representation. Then the systemcalculates the corresponding storage size and JPEG quality, and adjuststhe position of the cursors 1716 and 1736, respectively, to provide avisual feedback to the user. Or the user can select and move the cursor1736 to adjust the JPEG quality for the output representation. Thus thesystem calculates the corresponding storage size and JPEG resolution,and adjusts the position of the cursors 1716 and 1726, respectively, toprovide a visual feedback to the user.

In alternative implementations, the cursors 1726 and 1736 for the JPEGresolution and JPEG quality can be coupled only to the cursor 1716 forthe storage size, without being coupled to each other. Thus the user canset a particular JPEG resolution, and vary the JPEG quality to see howthe storage size is changing for different JPEG qualities at theparticular JPEG resolution. Or vice versa, the JPEG resolution can bevaried for a particular JPEG quality. Alternatively, the cursors 1726and 1736 for the JPEG resolution and JPEG quality can be strictlycoupled to each other according to a predefined relation. Thus anyposition of the cursor 1726 corresponds to a predefined position of thecursor 1736, and vice versa, to provide the predefined relation betweenthe JPEG resolution and JPEG quality. The predefined relation cancorrespond to a combination of JPEG resolution and quality that isoptimized for human perception of image quality.

FIG. 18A illustrates an exemplary user interface 1800 for specifyingcompression parameters for output representations of multiple digitalimages in a set of images. The user interface 1800 can be used by asystem that includes the representation generator 1220 (FIG. 12). Thesystem receives the set in which the images are represented in inputrepresentations that should be compressed into output representationsthat are more compact than the input representations. The image set ischaracterized by an original storage size and an original qualityparameter in the input representation. In one implementation, both theinput and output representations are JPEG representations, and theoriginal quality parameter represents a maximum JPEG quality or amaximum JPEG resolution, or a combination of JPEG quality andresolution.

The user interface 1800 includes a slider 1810 to specify a storageparameter for the entire image set, and a graphical size representation1820 to indicate storage sizes for the images in the image set. Theindicated storage sizes correspond to the storage parameter specified onthe slider 1810.

The slider 1810 specifies a maximum quality parameter for the outputrepresentations of all images in the set. The maximum quality parametercan correspond to a maximum resolution in a content channel, or minimumquantizors for representation components. On the slider 1810, theoriginal quality parameter is represented by an input marker 1812. Aminimum quality parameter is also represented on the slider 1810 by aminimum marker 1814. The minimum quality parameter defines a minimumacceptable output representation. For the output representation, acurrent value of the quality parameter is specified by a cursor 1816. Inthe example illustrated in FIG. 18A, the cursor 1816 is positioned atthe input marker, thus it specifies no compression for the image set.

The size representation 1820 illustrates the original storage sizes ofthe images in the set. In the example, the image set includes threeimages for which the size representation 1820 defines respectiverectangles 1821, 1823 and 1825. Each of the rectangles 1821, 1823 and1825 has a horizontal length that is proportional to the storage size ofthe corresponding image. The rectangles 1821, 1823 and 1825 are arrangedadjacent to each other in a row such that the size representation 1820has a total horizontal length that is the sum of the horizontal lengthsof the rectangles 1821, 1823 and 1825. Thus the total horizontal lengthof the size representation 1820 is proportional to the storage size ofthe entire image set.

Each of the rectangles 1821, 1823 and 1825 includes a correspondingimage representation 1822, 1824 and 1826, respectively. The imagerepresentation 1822 is a graphical representation of the first image(illustrating the letter “A”) in the set. Since the image representation1822 is enclosed in the rectangle 1821, the user can easily recognizethat the rectangle 1821 indicates the storage size of the first image.Similarly, the image representations 1824 and 1826 are graphicalrepresentations of the second image (illustrating the letter “B”) andthe third image (illustrating the letter “C”) in the set, and visuallyidentify that the rectangles 1823 and 1825 indicate the storage size forthe second and third images, respectively.

FIG. 18B illustrates the user interface 1800 when the user has moved thecursor 1816 on the slider from the input marker 1812 to a position thatis in between the minimum marker 1814 and the input marker 1812. Thusthe user indicated that the image set should be compressed to match areduced quality represented by that position. Based on the reducedquality, the system has estimated the compressed storage size for eachimage in the set, and presented a modified size representation 1820′ toillustrate the compressed storage sizes.

The modified size representation 1820′ defines respective rectangles1821′, 1823′ and 1825′ for the three images in the set. Each of therectangles 1821′, 1823′ and 1825′ encloses the corresponding imagerepresentation 1822, 1824, and 1826, and has a horizontal length that isproportional to the compressed size of the corresponding image. Therectangles 1821′, 1823′ and 1825′ are arranged in a row adjacent to eachother so the total horizontal length of the modified size representation1820′ is proportional to the storage size for the entire image set.

In the illustrated example, the first and third rectangles 1821′ and1825′ illustrate that the storage sizes of the first and third imageswould be slightly reduced due to the compression, while the secondrectangle 1823′ indicates that the storage size of the second imagewould be substantially reduced. Thus the user can identify thecompressed storage size not only for the entire set but also separatelyfor each image in the set.

In alternative implementations, the slider 1810 can specify thecompressed storage size for the entire set. Thus as the cursor 1816 ismoved from the input marker 1812 to the position 1818, the sizerepresentation 1820′ indicates separately for each image in the set howthe storage size has changed for the respective image. Instead of thesingle slider 1810, the user interface 1810 can use coupled sliderssimilar to those discussed above with reference to FIG. 17.

FIG. 19 illustrates exemplary size representations 1910 and 1920 thatcan be used to indicate storage sizes for multiple images. For example,the size representation 1910 or 1920 can be used instead of the sizerepresentation 1820 (FIG. 18A).

The size representation 1910 indicates storage sizes for the threeimages (illustrating the letters “A”, “B” and “C”, respectively) thatare also illustrated in FIGS. 18A and 18B. The size representation 1910includes three rectangular image representations 1912, 1914 and 1916whose horizontal lengths are proportional to the storage sizes of therespective images. Thus the first image representation 1912 ishorizontally stretched to have a horizontal length that is proportionalto the storage size of the first image in the set. Similarly the secondand third image representations 1914 and 1916 are horizontally stretchedto have a horizontal length that is proportional to the storage size ofthe second and third images, respectively. The image representations1912, 1914 and 1916 are arranged in a row adjacent to each other suchthat the total length of the size representation 1910 is proportional tothe total storage size for the entire image set.

The size representation 1920 illustrates an alternative arrangement forthe image representations 1912, 1914 and 1916. In the sizerepresentation 1920, the image representations 1912, 1914 and 1916 arearranged vertically such that the image representations' left side isaligned to the same horizontal position. Thus the right side of eachimage representation indicates the storage size of the respective image.The size representation 1920 emphasizes the variations in the storagesizes of the images. The size representation 1920 can be advantageouslyused if the total size for the image set is known or has less importancethan the variations. For example, the size representation 1920 can bepresented in a user interface while the user is adjusting a storage sizeslider similar to that of FIG. 17.

In alternative implementations, the image representations can have otherlinear sizes that are proportional to the indicated storage sizes. Forexample, each image representation can be stretched vertically to have avertical size that is proportional to the storage size of thecorresponding image. The vertically stretched image representations canbe arranged in a single column whose height is proportional to thestorage size for the entire image set. Or the vertically stretched imagerepresentations can be arranged to form a histogram.

The systems and techniques described in this application can beimplemented in one or more software applications, as a plug-in to asoftware application, or in hardware of electronic devices, such asimage capturing or displaying devices, for example digital cameras, CCDdevices, scanners, or portable devices such as personal digitalassistants or mobile phones. For portable devices, the system orportions of it can be implemented on a remote server.

The invention can be implemented in digital electronic circuitry, or incomputer hardware, firmware, software, or in combinations of them. Theinvention can be implemented as a computer program product, i.e., acomputer program tangibly embodied in an information carrier, e.g., in amachine-readable storage device or in a propagated signal, for executionby, or to control the operation of, data processing apparatus, e.g., aprogrammable processor, a computer, or multiple computers. A computerprogram can be written in any form of programming language, includingcompiled or interpreted languages, and it can be deployed in any form,including as a stand-alone program or as a module, component,subroutine, or other unit suitable for use in a computing environment. Acomputer program can be deployed to be executed on one computer or onmultiple computers at one site or distributed across multiple sites andinterconnected by a communication network.

Method steps of the invention can be performed by one or moreprogrammable processors executing a computer program to performfunctions of the invention by operating on input data and generatingoutput. Method steps can also be performed by, and apparatus of theinvention can be implemented as, special purpose logic circuitry, e.g.,an FPGA (field programmable gate array) or an ASIC (application-specificintegrated circuit).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read-only memory ora random access memory or both. The essential elements of a computer area processor for executing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto-optical disks, or optical disks. Information carrierssuitable for embodying computer program instructions and data includeall forms of non-volatile memory, including by way of examplesemiconductor memory devices, e.g., EPROM, EEPROM, and flash memorydevices; magnetic disks, e.g., internal hard disks or removable disks;magneto-optical disks; and CD-ROM and DVD-ROM disks. The processor andthe memory can be supplemented by, or incorporated in special purposelogic circuitry.

To provide for interaction with a user, the invention can be implementedon a computer having a display device, e.g., a CRT (cathode ray tube) orLCD (liquid crystal display) monitor, for displaying information to theuser and a keyboard and a pointing device, e.g., a mouse or a trackball,by which the user can provide input to the computer. Other kinds ofdevices can be used to provide for interaction with a user as well; forexample, feedback provided to the user can be any form of sensoryfeedback, e.g., visual feedback, auditory feedback, or tactile feedback;and input from the user can be received in any form, including acoustic,speech, or tactile input.

By way of example, a printing device implementing an interpreter for apage description language, such as the PostScript® language, includes amicroprocessor for executing program instructions (including fontinstructions) stored on a printer random access memory (RAM) and aprinter read-only memory (ROM) and controlling a printer marking engine.The RAM is optionally supplemented by a mass storage device such as ahard disk. The essential elements of a computer are a processor forexecuting instructions and a memory. A computer can generally alsoreceive programs and data from a storage medium such as an internal diskor a removable disk. These elements will also be found in a conventionaldesktop or workstation computer as well as other computers suitable forexecuting computer programs implementing the methods described here,which can be used in conjunction with any digital print engine ormarking engine, display monitor, or other raster output device capableof producing color or gray scale pixels on paper, film, display screen,or other output medium.

The invention has been described in terms of particular embodiments.Other embodiments are within the scope of the following claims. Forexample, the steps of the invention can be performed in a differentorder and still achieve desirable results. Although some of thetechniques are described for representations that use variable lengthencoding, such as JPEG representations of digital images, thesetechniques can be also applied to other data representations, such asLempel-Zif-Welch (“LZW”) representations, representations using Flate oranother compressed format such as the fax format of the ComitéConsultatif International Téléphonique et Télégraphique (CCITT).

1. A computer-implemented method for processing digital data, the method comprising: presenting, on a display device, a user interface that includes a graphical representation of a respective storage size for each of a plurality of digital images, the graphical representation including a respective graphics object for each digital image, the respective graphics object including a visual representation of the digital image and having a linear size that is proportional to the storage size of the digital image in an initial representation; receiving, through the user interface, user input specifying a value for each of one or more target parameters, of a plurality of target parameters, for an output representation of the plurality of digital images; generating, by data processing apparatus, an estimated storage size for the plurality of digital images in the output representation based on the received one or more target parameter values; and setting the linear size of each respective graphics object in the user interface to be proportional to the estimated storage size of the corresponding digital image in the output representation and presenting a graphical representation of a total estimated storage size for the plurality of digital images relative to the respective graphics objects.
 2. The method of claim 1, wherein: for each digital image, the corresponding graphics object encloses the visual representation of the image.
 3. The method of claim 1, wherein: each digital image is distorted in proportion to the storage size of the image.
 4. (canceled)
 5. (canceled)
 6. The method of claim 1, wherein receiving user input specifying values for one or more target parameters includes: presenting a respective slider for each target parameter in the user interface, wherein at least one of the sliders is a user adjustable slider; and specifying the value of each target parameter according to a current position of the respective user adjustable slider.
 7. The method of claim 6, wherein a first target parameter has a first allowable range, and wherein: presenting a slider for the first target parameter includes presenting a representation of the first allowable range in the user interface.
 8. The method of claim 7, further comprising: receiving user input modifying the first allowable range; and adjusting the representation of the first allowable range in the user interface.
 9. (canceled)
 10. The method of claim 1, wherein: the storage size of at least one digital image specifies a total number of bits representing the at least one image in the output representation.
 11. The method of claim 1, wherein: the storage size of at least one digital image specifies a transmission time for transmitting the at least one image in the output representation over a link.
 12. The method of claim 1, further comprising: presenting a reference storage size in the user interface.
 13. A computer program product, tangibly embodied in a machine-readable medium, for processing digital data, the computer product comprising instructions operable to cause one or more data processing apparatus to perform operations comprising: presenting a user interface that includes a graphical representation of a respective storage size for each of a plurality of digital images, the graphical representation including a respective graphics object for each digital image, the respective graphics object including a visual representation of the digital image and having a linear size that is proportional to the storage size of the digital image in an initial representation; receiving, through the user interface, user input specifying a value for each of one or more target parameters, of a plurality of target parameters, for an output representation of the plurality of digital images; generating an estimated storage size for the plurality of digital images in the output representation based on the received one or more target parameter values; and setting the linear size of each respective graphics object in the user interface to be proportional to the estimated storage size of the corresponding digital image in the output representation and presenting a graphical representation of a total estimated storage size for the plurality of digital images relative to the respective graphics objects.
 14. The computer program product of claim 13, wherein: for each digital image, the corresponding graphics object encloses the visual representation of the image.
 15. The computer program product of claim 13, wherein: each digital image is distorted in proportion to the storage size of the image.
 16. (canceled)
 17. (canceled)
 18. The computer program product of claim 13, wherein receiving user input specifying one or more values for target parameters includes: presenting a respective slider for each target parameter in the user interface, wherein at least one of the sliders is a user adjustable slider; and specifying the value for each target parameter according to a current position of the respective user adjustable slider.
 19. The computer program product of claim 18, wherein a first target parameter has a first allowable range, and wherein: presenting a slider for the first target parameter includes presenting a representation of the first allowable range in the user interface.
 20. The product of claim 19, further comprising instructions operable to cause one or more data processing apparatus to perform operations comprising: receiving user input modifying the first allowable range; and adjusting the representation of the first allowable range in the user interface.
 21. (canceled)
 22. The computer program product of claim 13, wherein: the storage size of at least one digital image specifies a total number of bits representing the at least one image in the output representation.
 23. The computer program product of claim 13, wherein: the storage size of at least one digital image specifies a transmission time for transmitting the at least one image in the output representation over a link.
 24. The computer program product of claim 13, further comprising instructions operable to cause one or more data processing apparatus to perform operations comprising: presenting a reference storage size in the user interface.
 25. A system for processing digital data, comprising: a user interface; and one or more computers operable to interact with the user interface and to perform operations including: presenting a user interface that includes a graphical representation of a respective storage size for each of a plurality of digital images, the graphical representation including a respective graphics object for each digital image, the respective graphics object including a visual representation of the digital image and having a linear size that is proportional to the storage size of the digital image in an initial representation; receiving, through the user interface, user input specifying a value for each of one or more target parameters, of a plurality of target parameters, for an output representation of the plurality of digital images; generating an estimated storage size for the plurality of digital images in the output representation based on the received one or more target parameter values; and setting the linear size of each respective graphics object in the user interface to be proportional to the estimated storage size of the corresponding digital image in the output representation and presenting a graphical representation of a total estimated storage size for the plurality of digital images relative to the respective graphics objects.
 26. The system of claim 25, wherein: for each digital image, the corresponding graphics object encloses the visual representation of the image.
 27. The system of claim 25, wherein: each digital image is distorted in proportion to the storage size of the image.
 28. (canceled)
 29. (canceled)
 30. The system of claim 25, wherein receiving user input specifying values for one or more target parameters includes: presenting a respective slider for each target parameter in the user interface, wherein at least one of the sliders is a user adjustable slider; and specifying the value of each target parameter according to a current position of the respective user adjustable slider.
 31. The system of claim 30, wherein a first target parameter has a first allowable range, and wherein: presenting a slider for the first target parameter includes presenting a representation of the first allowable range in the user interface.
 32. The system of claim 31, the one or more computers further operable to perform operations comprising: receiving user input modifying the first allowable range; and adjusting the representation of the first allowable range in the user interface.
 33. (canceled)
 34. The system of claim 25, wherein: the storage size of at least one digital image specifies a total number of bits representing the at least one image in the output representation.
 35. The system of claim 25, wherein: the storage size of at least one digital image specifies a transmission time for transmitting the at least one image in the output representation over a link.
 36. The system of claim 25, the one or more computers further operable to perform operations comprising: presenting a reference storage size in the user interface.
 37. The method of claim 1, wherein all of the graphics objects have equal heights, and each of the graphics objects has a width that is proportional to a storage size of the respective digital image.
 38. The method of claim 1, wherein each graphics object has a first dimension and a second dimension, the first dimension is equal for all of the graphics objects, and the second dimension for each graphics object is proportional to a storage size of the respective digital image.
 39. The method of claim 1, wherein the graphics objects are presented as a histogram.
 40. The computer program product of claim 13, wherein all of the graphics objects have equal heights, and each of the graphics objects has a width that is proportional to a storage size of the respective digital image.
 41. The computer program product of claim 13, wherein each graphics object has a first dimension and a second dimension, the first dimension is equal for all of the graphics objects, and the second dimension for each graphics object is proportional to a storage size of the respective digital image.
 42. The computer program product of claim 13, wherein the graphics objects are presented as a histogram.
 43. The system of claim 25, wherein all of the graphics objects have equal heights, and each of the graphics objects has a width that is proportional to a storage size of the respective digital image.
 44. The system of claim 25, wherein each graphics object has a first dimension and a second dimension, the first dimension is equal for all of the graphics objects, and the second dimension for each graphics object is proportional to a storage size of the respective digital image.
 45. The system of claim 25, wherein the graphics objects are presented as a histogram. 